@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --login-navy: #07141D;
  --login-graphite: #121C24;
  --login-blue: #173B50;
  --login-cyan: #16C5E5;
  --login-steel: #8495A1;
  --login-white: #F2F6F8;
  --login-amber: #F2A900;
  --login-line: rgba(132, 149, 161, .24);
  --login-font: 'DM Sans', 'Segoe UI', sans-serif;
  --login-display: 'Space Grotesk', 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--login-navy); }
body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--login-white);
  background: var(--login-navy);
  font-family: var(--login-font);
  -webkit-font-smoothing: antialiased;
}
.login-page :focus-visible { outline: 3px solid var(--login-amber); outline-offset: 3px; }
.login-wrapper {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(400px, .86fr);
  flex: 1 0 auto;
  min-height: min(790px, calc(100dvh - 68px));
  background: var(--login-navy);
}
.left-section, .right-section { position: relative; min-width: 0; overflow: hidden; }
.left-section {
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 5.4rem);
  background:
    linear-gradient(180deg, rgba(7,20,29,.30), rgba(7,20,29,.80) 40%, rgba(7,20,29,.80) 61%, rgba(7,20,29,.42)),
    url('../images/login-rare-earth.webp') center / cover no-repeat,
    var(--login-navy);
}
.left-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(79,157,179,.075) 1px,transparent 1px),linear-gradient(90deg,rgba(79,157,179,.075) 1px,transparent 1px);
  background-size: 38px 38px;
  opacity: .4;
  mask-image: linear-gradient(90deg, #000, transparent 84%);
}
.page-brand {
  position: absolute;
  z-index: 3;
  top: clamp(1.5rem, 3vw, 2.5rem);
  left: clamp(1.25rem, 3vw, 2.75rem);
  right: 1.25rem;
}
.page-brand .brand-product-label { margin-bottom: 0; }
.brand-content { position: relative; z-index: 2; width: min(100%, 610px); margin-inline: auto; text-align: center; }
.brand-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 21rem;
  height: 21rem;
  top: 6rem;
  right: -8rem;
  border-radius: 50%;
  background: rgba(13,104,127,.12);
  filter: blur(45px);
  pointer-events: none;
}
.brand-product-label { margin: 1rem 0 2.25rem; color: var(--login-cyan); font-size: .65rem; font-weight: 600; letter-spacing: .14em; line-height: 1.7; }
.brand-title { margin: 0; color: var(--login-white); font: 600 clamp(2.25rem, 4.2vw, 4.35rem)/.98 var(--login-display); letter-spacing: -.065em; }
.brand-title .iq { color: var(--login-cyan); }
.brand-headline { max-width: 580px; margin: 0 auto; font: 600 clamp(1.5rem, 2.8vw, 2.6rem)/1.2 var(--login-display); letter-spacing: -.035em; text-wrap: balance; }
.brand-subtitle { max-width: 520px; margin: 1rem auto 0; color: #bdcbd1; font-size: clamp(.92rem, 1.15vw, 1.03rem); line-height: 1.65; }
.brand-division { margin: 1.55rem 0 0; color: var(--login-amber); font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.division-rule { display: inline-block; width: 1.8rem; height: 1px; vertical-align: middle; margin-right: .65rem; background: var(--login-amber); }
.right-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.4rem, 4vw, 4rem);
  background:
    radial-gradient(ellipse at 90% 8%, rgba(23,59,80,.36), transparent 44%),
    linear-gradient(rgba(105,145,160,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(105,145,160,.045) 1px,transparent 1px),
    linear-gradient(145deg, #17232b 0%, #101920 100%);
  background-size: auto, 34px 34px, 34px 34px, auto;
}
.right-section::before { content:""; position:absolute; top:8%; left:0; bottom:8%; width:1px; background:linear-gradient(transparent,rgba(22,197,229,.55),transparent); }
.right-decorative-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floating-particle { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(22,197,229,.65); animation: particle-drift 16s linear infinite; }
.floating-particle:nth-child(7) { left:12%; bottom:-6px; }
.floating-particle:nth-child(8) { left:38%; bottom:-6px; animation-delay:-5s; }
.floating-particle:nth-child(9) { left:70%; bottom:-6px; animation-delay:-10s; }
.floating-particle:nth-child(10) { left:88%; bottom:-6px; animation-delay:-2s; }
.login-form-container {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: clamp(1.5rem, 3.2vw, 2.65rem);
  border: 1px solid rgba(132,149,161,.28);
  border-top-color: rgba(80,156,179,.52);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(27,39,47,.96), rgba(18,28,36,.98));
  box-shadow: 0 28px 72px rgba(0,0,0,.32), inset 0 1px rgba(242,246,248,.045);
  backdrop-filter: blur(16px);
}
.login-header { margin: 0 0 1.8rem; }
.login-header-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 1.25rem; border: 1px solid rgba(22,197,229,.36); border-radius: 8px; color: var(--login-cyan); background: rgba(9,47,61,.72); }
.login-header-icon i { font-size: 1.15rem; }
.login-title { margin: 0; color: var(--login-white); font: 600 clamp(1.55rem, 2.5vw, 1.9rem)/1.15 var(--login-display); letter-spacing: -.045em; }
.login-subtitle { margin: .55rem 0 0; color: #9eafb7; font-size: .9rem; line-height: 1.55; }
.login-page .form-floating { margin-bottom: 1.05rem; }
.login-page .form-floating > .form-control {
  height: 58px;
  min-height: 58px;
  padding: 1.5rem .95rem .35rem 2.85rem;
  border: 1px solid #42535d;
  border-radius: 5px;
  color: var(--login-white);
  background: rgba(9,17,22,.58);
  box-shadow: none;
  font-family: var(--login-font);
  font-size: .94rem;
}
.login-page .form-floating > label { padding: 1rem 2.85rem; color: #9cabb2; font-size: .88rem; }
.login-page .form-floating > .form-control:focus { border-color: var(--login-cyan); background: #101f27; box-shadow: 0 0 0 3px rgba(22,197,229,.15); }
.login-page .form-floating > .form-control:focus ~ label,
.login-page .form-floating > .form-control:not(:placeholder-shown) ~ label { color: #9ebfc8; }
.input-with-icon { position: relative; }
.input-icon { position: absolute; z-index: 3; top: 20px; left: 1rem; color: #81959e; font-size: .95rem; pointer-events: none; transition: color .18s ease; }
.input-with-icon:focus-within .input-icon { color: var(--login-cyan); }
.login-page .btn-login {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin-top: .28rem;
  border: 1px solid var(--login-cyan);
  border-radius: 5px;
  color: #061921;
  background: var(--login-cyan);
  font-size: .79rem;
  font-weight: 700;
  letter-spacing: .075em;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.login-page .btn-login:hover { transform: translateY(-1px); color: #061921; background: #50d5eb; border-color: #50d5eb; }
.login-page .btn-login:active { transform: translateY(0); }
.forgot-link, .register-link a, .back-to-login { color: #76d8e9; text-decoration: none; transition: color .18s ease; }
.forgot-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1.05rem; font-size: .83rem; }
.forgot-link:hover, .register-link a:hover, .back-to-login:hover { color: var(--login-white); text-decoration: underline; text-underline-offset: 3px; }
.divider { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0 1rem; color: #8e9da5; font-size: .72rem; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background: var(--login-line); }
.divider span { white-space: nowrap; }
.register-link { color: #a9b7be; text-align: center; font-size: .84rem; }
.register-link a { font-weight: 600; }
.challenge-intro { margin: -.35rem 0 1.25rem; color: #bdcbd1; font-size: .88rem; line-height: 1.65; text-align: left; }
.challenge-intro strong { color: var(--login-white); overflow-wrap: anywhere; }
.code-input { text-align: center; font-size: 1.2rem !important; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .42em; padding-left: 2.85rem !important; }
.code-help { margin: -.45rem 0 1rem; color: #9eafb7; font-size: .76rem; line-height: 1.5; }
.challenge-actions { display: grid; gap: .7rem; margin-top: 1.15rem; text-align: center; }
.btn-resend { width:100%; padding:.7rem 1rem; border:1px solid #50626c; border-radius:5px; color:#d4e0e4; background:rgba(9,17,22,.35); font-weight:600; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.btn-resend:hover { color:var(--login-white); border-color:var(--login-cyan); background:rgba(22,197,229,.08); }
.back-to-login { font-size:.82rem; font-weight:600; }
.login-page .alert { padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid rgba(132,149,161,.28); border-left-width: 3px; border-radius: 5px; font-size: .83rem; }
.login-page .alert-warning { color:#f4d99a; background:#30291b; border-left-color:#d2a54e; }
.login-page .alert-danger { color:#ffc1bd; background:#321f20; border-left-color:#e16f68; }
.login-page .alert-success { color:#a9e5ca; background:#162c25; border-left-color:#50ba8b; }
.login-page .alert-info { color:#a9e7f1; background:#142a31; border-left-color:#25b8d4; }
.login-page .btn-close { filter: invert(1); opacity:.72; }
.footer { display:flex; align-items:center; justify-content:space-between; gap:1rem 2rem; min-height:68px; padding:.85rem clamp(1rem,4vw,3.5rem); border-top:1px solid rgba(132,149,161,.18); color:#a0afb6; background:#09131a; }
.footer-content { display:contents; }
.footer-links { display:flex; align-items:center; gap:1.35rem; }
.footer-links a { display:inline-flex; align-items:center; gap:.4rem; color:#c1cbd0; font-size:.74rem; font-weight:500; text-decoration:none; transition:color .18s ease; }
.footer-links a i { color:var(--login-cyan); font-size:.78rem; }
.footer-links a:hover { color:var(--login-white); text-decoration:underline; text-underline-offset:3px; }
.footer-copyright { color:#94a3aa; font-size:.72rem; }
.footer-brand-statement { color:var(--login-amber); }
.policy-modal .modal-content { color:var(--login-white); border:1px solid #40535e; border-radius:8px; background:#17232b; }
.policy-modal .modal-header { border-bottom:1px solid #34464f; background:#101a21; }
.policy-modal .modal-title { color:var(--login-white); font:600 1.1rem var(--login-display); }
.policy-modal .modal-body { max-height:60vh; overflow-y:auto; color:#c2cdd2; }
.policy-modal .modal-body h5 { margin-top:1.15rem; color:#edf4f6; font:600 1rem var(--login-display); }
.policy-modal .modal-body h5:first-child { margin-top:0; }
.policy-modal .modal-body p, .policy-modal .modal-body li { color:#bdc9ce; line-height:1.7; }
.policy-modal .btn-close { filter:invert(1); }
@keyframes particle-drift { 0% { transform:translateY(0); opacity:0; } 15%,80% { opacity:.55; } 100% { transform:translateY(-72vh); opacity:0; } }

@media (max-width: 900px) {
  .login-wrapper { grid-template-columns: minmax(0,1fr) minmax(340px,.88fr); }
  .left-section { padding:2.2rem clamp(1.4rem,4vw,3rem); }
}
@media (max-width: 700px) {
  .login-wrapper { display:flex; flex-direction:column; min-height:0; }
  .left-section { flex-direction:column; min-height:0; padding:1.55rem clamp(1.1rem,6vw,2rem) 1.25rem; background-position:center 45%; }
  .page-brand { top:1.55rem; left:clamp(1.1rem,6vw,2rem); }
  .brand-content { width:min(100%,560px); margin:0 auto; padding-top:5.4rem; }
  .brand-product-label { margin:.65rem 0 1.25rem; }
  .brand-headline { max-width:470px; font-size:clamp(1.2rem,5vw,1.65rem); }
  .brand-subtitle { margin-top:.55rem; font-size:.83rem; }
  .brand-division { margin-top:.8rem; font-size:.64rem; }
  .right-section { padding:1.4rem 1rem 1.8rem; }
  .right-section::before { top:0; right:10%; bottom:auto; left:10%; width:auto; height:1px; background:linear-gradient(90deg,transparent,rgba(22,197,229,.52),transparent); }
  .login-form-container { width:min(100%,450px); padding:clamp(1.3rem,6vw,2rem); }
  .footer { flex-direction:column; justify-content:center; gap:.55rem; padding:.85rem 1rem; }
  .footer-links { gap:1.1rem; }
}
@media (max-width: 380px) {
  .brand-product-label { font-size:.57rem; }
  .code-input { letter-spacing:.3em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}
