/* ============================================================
   AICS Borealis — Design System v3.0 (Minimal Dark)
   Font: Oswald (headings) + Inter (body)
   Vision: Relaxing, clear, quiet luxury.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --primary: #ffffff;
  --primary-dark: #f0f0f0;
  --green: #10B981;
  --green-glow: rgba(16, 185, 129, 0.15);
  --amber: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --red: #EF4444;
  --red-glow: rgba(239, 68, 68, 0.1);

  --bg: #05080c;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-dark: #020305;
  --bg-dark-2: #080c12;

  --text-1: #FFFFFF;
  --text-2: rgba(255, 255, 255, 0.88); /* High contrast */
  --text-3: rgba(255, 255, 255, 0.62); /* raised: was 0.45, now WCAG AA compliant */
  --text-inv: #000000;

  --border: rgba(255, 255, 255, 0.10);
  --border-2: rgba(255, 255, 255, 0.18);

  --radius: 0px;
  --radius-lg: 0px;

  --shadow-glow: 0 0 15px rgba(255, 255, 255, 0.05);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-subtle { box-shadow: 0 0 20px rgba(255, 255, 255, 0.03); }
.glow-primary { box-shadow: 0 0 25px rgba(255, 255, 255, 0.08); }
.glow-green { box-shadow: 0 0 20px var(--green-glow); }
.glow-amber { box-shadow: 0 0 20px var(--amber-glow); }

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 40% at 5% 0%, rgba(16,185,129,0.022) 0%, transparent 50%),
    radial-gradient(ellipse 60% 35% at 95% 90%, rgba(139,92,246,0.018) 0%, transparent 50%);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

a {
  color: var(--text-1);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  display: block;
}

/* ---- Header ---- */
.header {
  background: var(--bg-dark);
  padding: 0 16px;
  height: 54px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.header .container {
  background: transparent !important;
  max-width: 100%;
  width: 100%;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo:hover {
  color: var(--text-2) !important;
}

.logo .badge {
  font-size: 10px;
  padding: 3px 7px;
}

/* ---- Language switcher ---- */
.language-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.lang-btn:hover,
.lang-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ---- Main content ---- */
.main-content {
  min-height: calc(100vh - 54px - 64px);
  overflow-x: hidden;
}

.main-content .container {
  background: transparent !important;
  padding-top: 0;
}

/* ---- Bottom navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(2, 3, 5, 0.92) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex !important;
  align-items: stretch;
  z-index: 9999;
  height: 60px;
  visibility: visible !important;
  opacity: 1 !important;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 4px;
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
}

.bottom-nav-item:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.03);
}

.bottom-nav-item.active {
  color: #fff;
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.bottom-nav-icon {
  font-size: 18px;
  line-height: 1;
}

/* ---- Cards — frosted glass + neon corners ---- */
.card {
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.065) 0%,
    rgba(255,255,255,0.022) 55%,
    rgba(255,255,255,0.042) 100%
  ) !important;
  backdrop-filter: blur(24px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 0 -1px 0 rgba(0,0,0,0.15) !important;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--text-1) !important;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 20px;
  border-top: 1px solid rgba(16,185,129,0.32);
  border-left: 1px solid rgba(16,185,129,0.32);
  pointer-events: none;
  z-index: 2;
}
.card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  border-bottom: 1px solid rgba(16,185,129,0.32);
  border-right: 1px solid rgba(16,185,129,0.32);
  pointer-events: none;
  z-index: 2;
}
.card:hover {
  border-color: rgba(255,255,255,0.14) !important;
  box-shadow:
    0 14px 44px rgba(0,0,0,0.52),
    0 0 0 1px rgba(16,185,129,0.07),
    0 0 40px rgba(16,185,129,0.04),
    inset 0 1px 0 rgba(255,255,255,0.09) !important;
}

.card-header {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid rgba(16,185,129,0.1);
  padding: 16px 20px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-1);
  position: relative;
  z-index: 1;
}

.card-body {
  padding: 24px;
  position: relative;
  z-index: 1;
}

.card.shadow,
.card.shadow-lg {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5) !important;
}

.card.border-0 {
  border: none;
}

/* ---- Form controls — nero glass ---- */
.form-control,
.form-select {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.48) !important;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.3);
  transition: all var(--transition);
}

/* Dropdown options: sfondo scuro esplicito */
.form-select option,
select option {
  background-color: #0d1117;
  color: #e8eaed;
}
.form-select option:hover,
select option:hover,
.form-select option:checked,
select option:checked {
  background-color: #1a2332;
  color: #ffffff;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 300;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(0, 0, 0, 0.58) !important;
  box-shadow: 0 0 0 1px rgba(16,185,129,0.18), 0 0 20px rgba(16,185,129,0.07), inset 0 1px 0 rgba(255,255,255,0.08);
  outline: none;
  color: #fff;
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--red);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.05);
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  display: block;
  letter-spacing: 0.02em;
}

.form-text {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}

/* ---- Buttons ---- */
.btn {
  font-weight: 600;
  border-radius: var(--radius);
  padding: 11px 24px;
  font-size: 14px;
  transition: all var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: #f0f0f0;
  color: #000000;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-warning {
  background: var(--amber);
  color: #fff;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #fff;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- Alerts ---- */
.alert {
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
}

.alert-danger {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.02);
}

.alert-warning {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.02);
}

/* ---- Badges ---- */
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.bg-success { background: var(--green) !important; }
.bg-warning { background: var(--amber) !important; }
.bg-danger  { background: var(--red) !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* ---- Utilities ---- */
.text-muted { color: var(--text-3) !important; }
.text-white { color: #fff !important; }

@media (max-width: 768px) {
  .card-body { padding: 18px; }
  input, select, textarea { font-size: 16px !important; }
}
