  @import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

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

  :root {
    --sky:       #0EA5E9;
    --sky-light: #38BDF8;
    --sky-dark:  #0369A1;
    --ink:       #0C1A2E;
    --ink-mid:   #1E3A5F;
    --slate:     #64748B;
    --mist:      #F0F7FF;
    --white:     #FFFFFF;
    --gold:      #F59E0B;
    --radius:    16px;
    --shadow:    0 24px 64px rgba(3,105,161,0.18);
  }

  html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--ink);
    overflow: hidden;
  }

  /* ── Animated background canvas ── */
  .ams-bg {
    position: fixed; inset: 0; z-index: 0;
    background: linear-gradient(135deg, #0C1A2E 0%, #0E2A4A 50%, #0C1F38 100%);
    overflow: hidden;
  }

  .ams-bg::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 10% 20%, rgba(14,165,233,0.18) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 90% 80%, rgba(56,189,248,0.12) 0%, transparent 55%),
      radial-gradient(ellipse 40% 40% at 50% 50%, rgba(3,105,161,0.08) 0%, transparent 60%);
  }

  /* Floating orbs */
  .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    animation: drift linear infinite;
  }
  .orb-1 { width: 420px; height: 420px; background: var(--sky); top: -120px; left: -80px; animation-duration: 22s; }
  .orb-2 { width: 300px; height: 300px; background: var(--sky-light); bottom: -60px; right: -60px; animation-duration: 28s; animation-delay: -8s; }
  .orb-3 { width: 200px; height: 200px; background: var(--gold); top: 40%; right: 10%; animation-duration: 18s; animation-delay: -4s; opacity: 0.12; }

  @keyframes drift {
    0%   { transform: translate(0,0) scale(1); }
    33%  { transform: translate(30px,-20px) scale(1.05); }
    66%  { transform: translate(-20px,15px) scale(0.97); }
    100% { transform: translate(0,0) scale(1); }
  }

  /* Grid overlay */
  .ams-grid {
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(14,165,233,0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(14,165,233,0.06) 1px, transparent 1px);
    background-size: 48px 48px;
  }

  /* ── Page layout ── */
  .ams-page {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 480px 1fr;
    grid-template-rows: 1fr auto 1fr;
    align-items: center;
    justify-items: center;
    padding: 24px;
  }

  /* ── Left brand panel (decorative) ── */
  .ams-brand-panel {
    grid-column: 1;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    animation: slideLeft 0.9s cubic-bezier(0.22,1,0.36,1) both;
  }

  @keyframes slideLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  .brand-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(14,165,233,0.15);
    border: 1px solid rgba(14,165,233,0.3);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 28px;
    width: fit-content;
  }

  .brand-tag-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--sky-light);
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.75); }
  }

  .brand-tag-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sky-light);
  }

  .brand-headline {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 3.2vw, 3.4rem);
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 20px;
  }

  .brand-headline span { color: var(--sky-light); }

  .brand-sub {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    max-width: 320px;
    margin-bottom: 40px;
  }

  .brand-stats {
    display: flex;
    gap: 32px;
  }

  .stat-item { display: flex; flex-direction: column; gap: 4px; }
  .stat-num {
    font-family: 'Syne', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--sky-light);
  }
  .stat-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
  }

  .stat-divider {
    width: 1px;
    background: rgba(255,255,255,0.1);
    align-self: stretch;
  }

  /* ── Card ── */
  .ams-card {
    grid-column: 2;
    grid-row: 1 / 4;
    width: 100%;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 28px;
    padding: 48px 44px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
    animation: fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.1s both;
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Logo area */
  .card-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .logo-ring {
    position: relative;
    width: 84px; height: 84px;
    margin-bottom: 20px;
  }

  .logo-ring::before {
    content: '';
    position: absolute; inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--sky), var(--sky-light), var(--gold), var(--sky));
    animation: spin 6s linear infinite;
    padding: 2px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  .logo-ring img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(14,165,233,0.08);
    padding: 10px;
  }

  .card-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--white);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
  }

  .card-sub {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.02em;
  }

  /* Flash messages */
  .alert-ams {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .alert-danger  { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #FCA5A5; }
  .alert-success { background: rgba(34,197,94,0.13); border: 1px solid rgba(34,197,94,0.3); color: #86EFAC; }

  /* Form fields */
  .field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
  }

  .field-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
  }

  .field-wrap {
    position: relative;
  }

  .field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.25);
    pointer-events: none;
    transition: color 0.2s;
  }

  .field-wrap:focus-within .field-icon { color: var(--sky-light); }

  .field-input {
    width: 100%;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    color: var(--white) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    padding: 14px 16px 14px 46px !important;
    outline: none !important;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s !important;
    -webkit-appearance: none;
  }

  .field-input::placeholder { color: rgba(255,255,255,0.2) !important; }

  .field-input:focus {
    background: rgba(14,165,233,0.08) !important;
    border-color: rgba(14,165,233,0.5) !important;
    box-shadow: 0 0 0 4px rgba(14,165,233,0.1) !important;
  }

  /* Chrome autocomplete fix */
  .field-input:-webkit-autofill,
  .field-input:-webkit-autofill:hover,
  .field-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0E2A4A inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff !important;
    border-color: rgba(14,165,233,0.4) !important;
  }

  /* Password toggle */
  .pw-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.25);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
  }
  .pw-toggle:hover { color: var(--sky-light); }

  /* Submit button */
  .btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--sky-dark) 0%, var(--sky) 60%, var(--sky-light) 100%);
    border: none;
    border-radius: 12px;
    color: var(--white);
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 15px 24px;
    cursor: pointer;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(14,165,233,0.35);
  }

  .btn-login::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent);
    opacity: 0;
    transition: opacity 0.2s;
  }
  .btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(14,165,233,0.45); }
  .btn-login:hover::before { opacity: 1; }
  .btn-login:active { transform: translateY(0); }

  .btn-login-inner {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    position: relative; z-index: 1;
  }

  /* Divider + footer */
  .card-footer-note {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: rgba(255,255,255,0.22);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .card-footer-note::before,
  .card-footer-note::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
  }

  /* ── Right decorative panel ── */
  .ams-deco-panel {
    grid-column: 3;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 48px;
    gap: 20px;
    animation: slideRight 0.9s cubic-bezier(0.22,1,0.36,1) 0.05s both;
  }

  @keyframes slideRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  .feature-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px 20px;
    width: 220px;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
  }
  .feature-chip:hover {
    background: rgba(14,165,233,0.08);
    border-color: rgba(14,165,233,0.2);
    transform: translateX(-4px);
  }

  .chip-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(14,165,233,0.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--sky-light);
  }

  .chip-text { display: flex; flex-direction: column; gap: 2px; }
  .chip-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); }
  .chip-desc  { font-size: 11px; font-weight: 300; color: rgba(255,255,255,0.3); }

  /* Bottom copyright */
  .ams-footer {
    grid-column: 1 / 4;
    grid-row: 3;
    align-self: end;
    text-align: center;
    font-size: 11.5px;
    color: rgba(255,255,255,0.18);
    padding-bottom: 20px;
    letter-spacing: 0.04em;
  }

  /* ── Responsive ── */
  @media (max-width: 960px) {
    .ams-page {
      grid-template-columns: 1fr;
      grid-template-rows: auto;
      overflow-y: auto;
      align-content: start;
      padding: 32px 16px;
    }
    .ams-brand-panel, .ams-deco-panel { display: none; }
    .ams-card { grid-column: 1; grid-row: auto; }
    html, body { overflow: auto; }
  }