/* Foundi — Main Stylesheet */

/* =================== DESIGN TOKENS =================== */
    :root {
      /* Surfaces */
      --bg: #f4f6fa;
      --bg-alt: #eef1f8;
      --surface: #ffffff;
      --surface-raised: #ffffff;
      /* Text */
      --text: #0f172a;
      --text-secondary: #3e4c63;
      --text-muted: #8892a4;
      /* Brand — professional navy-blue trust palette */
      --primary: #1a56db;
      --primary-hover: #1648b8;
      --primary-light: #eef2ff;
      --primary-glow: rgba(26,86,219,.12);
      --accent: #0369a1;
      --accent-2: #7c3aed;
      /* Semantic */
      --success: #0d9f55;
      --success-light: #ecfdf3;
      --danger: #dc2626;
      --danger-light: #fef2f2;
      --warning: #e8850c;
      /* Borders */
      --border: #dfe4ee;
      --border-light: #eef1f7;
      /* Radii */
      --radius-sm: 10px;
      --radius: 14px;
      --radius-lg: 18px;
      --radius-xl: 24px;
      --radius-2xl: 28px;
      --radius-full: 9999px;
      /* Shadows — layered for depth */
      --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
      --shadow: 0 2px 4px rgba(15,23,42,.03), 0 6px 18px rgba(15,23,42,.05);
      --shadow-lg: 0 4px 8px rgba(15,23,42,.04), 0 12px 36px rgba(15,23,42,.06);
      --shadow-xl: 0 8px 16px rgba(15,23,42,.04), 0 24px 56px rgba(15,23,42,.07);
      --shadow-glow: 0 0 0 1px rgba(26,86,219,.04), 0 8px 40px rgba(26,86,219,.06);
      /* Layout */
      --max-w: 1200px;
      --header-h: 72px;
      /* Motion */
      --ease: cubic-bezier(.4,0,.2,1);
      --ease-spring: cubic-bezier(.34,1.56,.64,1);
      --dur: .2s;
      --dur-slow: .4s;
    }

    /* =================== RESET & BASE =================== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
      font-size: 15px;
      color: var(--text);
      background: var(--bg);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
    a:hover { color: var(--primary-hover); }
    img { max-width: 100%; height: auto; display: block; }
    ::selection { background: var(--primary); color: #fff; }

    /* Focus-visible for a11y */
    :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

    /* Reduced motion */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
      html { scroll-behavior: auto; }
    }

    /* =================== LAYOUT =================== */
    .container { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }
    main { flex: 1; }

    /* =================== TYPOGRAPHY =================== */
    .page-title {
      font-size: clamp(26px, 4vw, 38px);
      font-weight: 800;
      letter-spacing: -.03em;
      line-height: 1.1;
      color: var(--text);
    }
    .section-title { font-size: clamp(18px, 2.5vw, 22px); font-weight: 700; letter-spacing: -.01em; }
    .text-secondary { color: var(--text-secondary); }
    .text-muted { color: var(--text-muted); }
    .text-sm { font-size: 14px; }
    .text-xs { font-size: 12px; }
    .text-center { text-align: center; }

    /* =================== CARD =================== */
    .card {
      background: var(--surface);
      border-radius: var(--radius-xl);
      padding: clamp(22px, 3vw, 32px);
      box-shadow: var(--shadow);
      border: 1px solid var(--border-light);
      transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
    }
    .card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

    /* =================== BUTTONS =================== */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 24px;
      font-size: 15px;
      font-weight: 600;
      font-family: inherit;
      border: none;
      border-radius: var(--radius);
      cursor: pointer;
      transition: all var(--dur) var(--ease);
      text-decoration: none;
      line-height: 1.4;
      position: relative;
      white-space: nowrap;
    }
    .btn-primary {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 16px rgba(26,86,219,.28);
    }
    .btn-primary:hover {
      background: var(--primary-hover);
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 8px 24px rgba(26,86,219,.32);
    }
    .btn-primary:active { transform: translateY(0); }
    .btn-success {
      background: var(--success);
      color: #fff;
      box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 16px rgba(13,159,85,.28);
    }
    .btn-success:hover {
      background: #0b8a4a;
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 8px 24px rgba(13,159,85,.32);
    }
    .btn-outline {
      background: var(--surface);
      color: var(--text);
      border: 1.5px solid var(--border);
    }
    .btn-outline:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--primary-light);
    }
    .btn-ghost { background: transparent; color: var(--text-secondary); padding: 8px 14px; }
    .btn-ghost:hover { color: var(--primary); background: var(--primary-light); }
    .btn-block { width: 100%; }
    .btn-sm { padding: 9px 18px; font-size: 13px; border-radius: var(--radius-sm); }
    .btn-lg { padding: 16px 36px; font-size: 16px; border-radius: 16px; letter-spacing: -.01em; }

    /* =================== FORMS =================== */
    .form-group { margin-bottom: 18px; }
    .form-label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 7px;
    }
    .form-input {
      width: 100%;
      padding: 13px 16px;
      font-size: 15px;
      font-family: inherit;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface);
      color: var(--text);
      transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
      outline: none;
    }
    .form-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 4px var(--primary-glow);
    }
    .form-input::placeholder { color: var(--text-muted); }
    textarea.form-input { resize: vertical; min-height: 88px; }

    /* Toggle switch */
    .toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 0;
      border-bottom: 1px solid var(--border-light);
    }
    .toggle-row:last-child { border-bottom: none; }
    .toggle-label { font-size: 14px; color: var(--text); font-weight: 500; }
    .toggle { position: relative; width: 48px; height: 26px; flex-shrink: 0; cursor: pointer; }
    .toggle input { opacity: 0; width: 0; height: 0; }
    .toggle-slider {
      position: absolute; inset: 0;
      background: #c5cdd8;
      border-radius: 13px;
      cursor: pointer;
      transition: all .25s var(--ease);
    }
    .toggle-slider::before {
      content: '';
      position: absolute;
      width: 20px; height: 20px;
      left: 3px; top: 3px;
      background: #fff;
      border-radius: 50%;
      transition: transform .25s var(--ease-spring);
      box-shadow: 0 1px 3px rgba(0,0,0,.15);
    }
    .toggle input:checked + .toggle-slider { background: var(--primary); }
    .toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

    /* =================== ALERTS =================== */
    .alert {
      padding: 14px 18px;
      border-radius: var(--radius);
      font-size: 14px;
      font-weight: 500;
      margin-bottom: 18px;
    }
    .alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
    .alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
    .alert-info { background: var(--primary-light); color: #1e3a8a; border: 1px solid #c7d2fe; }

    /* =================== BADGE =================== */
    .badge {
      display: inline-flex;
      padding: 4px 12px;
      font-size: 12px;
      font-weight: 600;
      border-radius: var(--radius-full);
      letter-spacing: .02em;
    }
    .badge-success { background: var(--success-light); color: var(--success); }
    .badge-warning { background: #fffbeb; color: #92400e; }

    /* =================== AUTH LAYOUT =================== */
    .auth-wrapper {
      max-width: 440px;
      margin: clamp(32px, 6vh, 80px) auto;
      padding: 0 16px;
    }
    .auth-card {
      background: var(--surface);
      border-radius: var(--radius-2xl);
      padding: clamp(32px, 5vw, 48px);
      box-shadow: var(--shadow-xl);
      border: 1px solid var(--border-light);
      position: relative;
      overflow: hidden;
    }
    .auth-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-2));
    }
    .auth-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.025em; }
    .auth-subtitle { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; line-height: 1.5; }
    .auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
    .auth-footer a { font-weight: 600; }
    .auth-divider { color: var(--text-muted); margin: 0 8px; }

    /* =================== HEADER =================== */
    header {
      position: sticky;
      top: 0;
      height: var(--header-h);
      background: rgba(255,255,255,.82);
      backdrop-filter: blur(16px) saturate(180%);
      -webkit-backdrop-filter: blur(16px) saturate(180%);
      border-bottom: 1px solid rgba(0,0,0,.05);
      z-index: 100;
    }
    .nav-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: var(--header-h);
    }
    .brand {
      display: flex;
      align-items: center;
      transition: opacity .2s ease;
    }
    .brand:hover { opacity: .85; }
    .brand-logo {
      height: 70px;
      display: flex; align-items: center;
      transition: transform .3s var(--ease-spring);
    }
    .brand:hover .brand-logo { transform: scale(1.03); }
    .brand-logo img { height: 100%; width: auto; object-fit: contain; }
    .brand-logo svg { width: 18px; height: 18px; }
    .brand-text { font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -.02em; }
    .nav-actions { display: flex; align-items: center; gap: 8px; }

    /* Lang switcher */
    .lang-switcher { position: relative; }
    .lang-btn {
      display: flex; align-items: center; gap: 5px;
      padding: 7px 14px;
      font-size: 13px; font-weight: 600; font-family: inherit;
      background: var(--bg-alt);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      cursor: pointer;
      color: var(--text-secondary);
      transition: all var(--dur) var(--ease);
    }
    .lang-btn:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }
    .lang-menu {
      display: none;
      position: absolute; top: 44px; right: 0;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow-xl);
      overflow: hidden;
      min-width: 150px;
      z-index: 200;
    }
    .lang-link { display: block; padding: 11px 18px; font-size: 14px; color: var(--text); transition: background var(--dur) var(--ease); }
    .lang-link:hover { background: var(--bg-alt); color: var(--text); }
    .lang-link.active-lang { font-weight: 600; color: var(--primary); background: var(--primary-light); }

    /* Mobile nav */
    .menu-toggle {
      display: none;
      background: none; border: none;
      width: 44px; height: 44px;
      font-size: 22px;
      cursor: pointer;
      color: var(--text);
      border-radius: var(--radius-sm);
      transition: background var(--dur) var(--ease);
    }
    .menu-toggle:hover { background: var(--bg-alt); }

    @media (max-width: 768px) {
      .menu-toggle { display: flex; align-items: center; justify-content: center; }
      .nav-actions {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-xl);
        padding: 16px 20px; gap: 8px;
        display: none;
      }
      .nav-actions.open { display: flex; }
      .nav-actions .btn { width: 100%; justify-content: center; }
      .lang-switcher { align-self: flex-end; }
    }

    /* =================== FOOTER =================== */
    footer {
      margin-top: auto;
      background: var(--surface);
      border-top: 1px solid var(--border-light);
    }
    .footer-inner {
      max-width: var(--max-w);
      margin: auto;
      padding: 28px clamp(16px, 4vw, 28px);
      display: flex; flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
    }
    .footer-links { display: flex; gap: 24px; font-size: 13px; }
    .footer-links a { color: var(--text-muted); font-weight: 500; transition: color var(--dur) var(--ease); }
    .footer-links a:hover { color: var(--primary); }
    .footer-copy { font-size: 12px; color: var(--text-muted); }

    @media (max-width: 600px) {
      .footer-inner { flex-direction: column; text-align: center; }
      .footer-links { justify-content: center; flex-wrap: wrap; }
    }

    /* =================== UTILITY =================== */
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .stack { display: flex; flex-direction: column; gap: 16px; }
    .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
    .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

    @media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

    /* =================== ANIMATIONS =================== */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(18px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .animate-in { animation: fadeUp .5s var(--ease) both; }
    .animate-in-delay { animation: fadeUp .5s var(--ease) .1s both; }
    .animate-in-delay-2 { animation: fadeUp .5s var(--ease) .2s both; }

    /* =================== COOKIE CONSENT =================== */
    .cookie-banner {
      position: fixed;
      bottom: 0; left: 0; right: 0;
      background: var(--surface);
      border-top: 1px solid var(--border);
      box-shadow: 0 -4px 24px rgba(0,0,0,.08);
      padding: 18px 24px;
      z-index: 9999;
      display: none;
    }
    .cookie-banner.show { display: block; }
    .cookie-inner {
      max-width: var(--max-w);
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }
    .cookie-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; min-width: 200px; }
    .cookie-text a { font-weight: 600; color: var(--primary); text-decoration: underline; }
    .cookie-actions { display: flex; gap: 8px; }

    /* =================== EXTENDED UTILITIES =================== */
    .d-flex { display: flex; }
    .d-inline { display: inline; }
    .d-contents { display: contents; }
    .d-grid { display: grid; }
    .flex-col { flex-direction: column; }
    .flex-wrap { flex-wrap: wrap; }
    .items-center { align-items: center; }
    .justify-center { justify-content: center; }
    .justify-between { justify-content: space-between; }
    .gap-1 { gap: 6px; }
    .gap-2 { gap: 10px; }
    .gap-3 { gap: 12px; }
    .gap-4 { gap: 16px; }

    .text-right { text-align: right; }
    .text-danger { color: var(--danger); }
    .text-mono { font-family: monospace; font-size: 12px; }
    .font-normal { font-weight: 400; }
    .font-bold { font-weight: 700; }

    .mb-0 { margin-bottom: 0; }
    .mb-xs { margin-bottom: 8px; }
    .mb-sm { margin-bottom: 12px; }
    .mb-md { margin-bottom: 16px; }
    .mb-lg { margin-bottom: 20px; }
    .mb-xl { margin-bottom: 24px; }
    .mb-2xl { margin-bottom: 28px; }
    .mt-xs { margin-top: 8px; }
    .mt-sm { margin-top: 12px; }
    .mt-md { margin-top: 16px; }
    .mt-lg { margin-top: 20px; }
    .mt-xl { margin-top: 24px; }

    .p-0 { padding: 0; }
    .overflow-x-auto { overflow-x: auto; }
    .overflow-hidden { overflow: hidden; }
    .w-full { width: 100%; }

    .flex-bar { display: flex; justify-content: space-between; align-items: center; }
    .logo-inline { height: 48px; width: auto; display: inline-block; }
    .empty-state { text-align: center; padding: 32px; color: var(--text-muted); }
    .badge-danger { background: var(--danger-light); color: var(--danger); }
    .accent-primary { accent-color: var(--primary); }
    .mx-auto { margin-left: auto; margin-right: auto; }
    .center-block { margin: 0 auto 16px; text-align: center; }
