:root {
  color-scheme: dark;
  --bg: #06100b;
  --panel: #0a1710;
  --panel-soft: #0e1d15;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #90a298;
  --text: #f4f8f5;
  --green: #33dc77;
  --green-deep: #119744;
  --danger: #ff8b91;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 8%, rgba(51, 220, 119, 0.08), transparent 28rem),
    var(--bg);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(500px, 1.08fr);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(155deg, rgba(51, 220, 119, 0.13), transparent 40%),
    linear-gradient(180deg, #0b1d13, #07110c);
  border-right: 1px solid var(--line);
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -210px;
  bottom: 12%;
  border: 1px solid rgba(51, 220, 119, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(51, 220, 119, 0.018), 0 0 0 140px rgba(51, 220, 119, 0.012);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: var(--text);
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand img, .mobile-brand img {
  border-radius: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.brand-copy { position: relative; z-index: 1; margin: auto 0 40px; max-width: 590px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.17em; }

.brand-copy h1 {
  margin: 22px 0 24px;
  font-size: clamp(46px, 5.2vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.brand-copy h1 span { color: var(--green); }
.brand-copy h1 .brand-title-light { color: var(--text); }
.brand-copy p { max-width: 510px; margin: 0; color: #b7c4bc; font-size: 17px; line-height: 1.65; }

.preview-card {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  padding: 23px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.preview-top { display: flex; justify-content: space-between; align-items: center; }
.preview-logo-image { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24); }
.live-dot { color: #8ceaad; font-size: 9px; font-weight: 800; letter-spacing: 0.14em; }
.live-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.preview-card p { margin: 28px 0 6px; color: var(--muted); font-size: 12px; }
.preview-card strong { font-size: 16px; }
.preview-lines { display: flex; gap: 7px; margin-top: 22px; }
.preview-lines i { display: block; height: 4px; flex: 1; border-radius: 8px; background: var(--green); opacity: 0.9; }
.preview-lines i:nth-child(2) { opacity: 0.38; }
.preview-lines i:nth-child(3) { opacity: 0.15; }
.brand-foot { position: relative; z-index: 1; margin: 30px 0 0; color: #71847a; font-size: 11px; letter-spacing: 0.08em; }

.form-panel { min-height: 100vh; display: grid; place-items: center; padding: 34px clamp(26px, 6vw, 90px); }
.form-wrap { position: relative; width: min(100%, 440px); }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 45px; font-size: 20px; }
.login-controls { position: absolute; z-index: 4; top: 0; right: 0; display: flex; align-items: center; gap: 8px; }
.language-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.language-switch button { min-width: 38px; padding: 7px 8px; border: 0; border-radius: 8px; color: #74867c; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.language-switch button.is-active { color: var(--text); background: #1b2c22; }
.theme-toggle { position: relative; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: #b8c8bf; background: rgba(255, 255, 255, .025); cursor: pointer; transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.theme-toggle:hover { color: var(--green); border-color: rgba(51, 220, 119, .35); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.theme-icon { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transform: translate(-50%, -50%); transform-origin: center; transition: opacity 180ms ease, transform 180ms ease; }
.theme-icon-sun { opacity: 1; }
.theme-icon-moon { opacity: 0; transform: translate(-50%, -50%) scale(.86); }
[data-theme="light"] .theme-icon-sun { opacity: 0; transform: translate(-50%, -50%) scale(.84) rotate(90deg); }
[data-theme="light"] .theme-icon-moon { opacity: 1; transform: translate(-50%, -50%) scale(.94); }
.form-heading { margin-bottom: 30px; }
.form-heading h2 { margin: 14px 0 8px; font-size: clamp(34px, 3.5vw, 44px); letter-spacing: -0.055em; }
.form-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.register-wrap { width: min(100%, 520px); }
.register-heading { margin-bottom: 30px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; color: #cbd5cf; font-size: 11px; font-weight: 700; }
.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.field input::placeholder { color: #607168; }
.field input:focus { border-color: rgba(51, 220, 119, 0.65); background: rgba(51, 220, 119, 0.035); box-shadow: 0 0 0 4px rgba(51, 220, 119, 0.08); }
.input-with-icon, .password-wrap { position: relative; }
.input-with-icon input { padding-left: 48px; }
.password-wrap input { padding-left: 48px; padding-right: 82px; }
.field-leading-icon { position: absolute; z-index: 1; left: 17px; top: 50%; display: block; width: 20px; height: 20px; transform: translate3d(0, -50%, 0); color: #789086; pointer-events: none; shape-rendering: geometricPrecision; }
.icon-mail, .icon-lock, .icon-user { width: 20px; height: 20px; }
.show-password { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); padding: 8px; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.remember { display: flex; gap: 10px; align-items: center; width: fit-content; margin: 2px 0 20px; color: var(--muted); font-size: 11px; cursor: pointer; }
.remember input { width: 16px; height: 16px; accent-color: var(--green-deep); }

.two-factor { margin: 26px 0 22px; padding: 20px; border: 1px solid rgba(51, 220, 119, 0.22); border-radius: 18px; background: rgba(51, 220, 119, 0.045); }
.two-factor-heading { display: flex; gap: 13px; margin-bottom: 20px; }
.two-factor-heading strong { font-size: 13px; }
.two-factor-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.shield-mark { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 38px; color: #07110c; background: var(--green); border-radius: 11px 11px 15px 15px; font-weight: 900; }
.two-factor .field:last-child { margin-bottom: 0; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.text-button:hover { text-decoration: underline; }

.form-message { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; color: var(--danger); background: rgba(255, 107, 116, 0.08); font-size: 12px; line-height: 1.45; }
.form-message.is-info { color: #b4e8c7; background: rgba(51, 220, 119, 0.08); }
.form-message.is-success { color: var(--green); background: rgba(51, 220, 119, 0.08); }
.submit-button {
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  color: #041009;
  background: var(--green);
  box-shadow: 0 14px 32px rgba(23, 186, 84, 0.18);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}
.submit-button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.submit-button:disabled { cursor: wait; filter: saturate(0.45); transform: none; }
.button-arrow { font-size: 19px; line-height: 1; transition: transform 160ms ease; }
.submit-button:hover .button-arrow { transform: translateX(3px); }
.signup-note { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.signup-note a { color: var(--green); font-weight: 750; text-decoration: none; }
.social-login { margin-top: 20px; }
.social-divider { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: #71847a; font-size: 10px; }
.social-divider::before, .social-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.social-divider span { white-space: nowrap; }
.social-auth-buttons { display: flex; align-items: center; justify-content: center; gap: 10px; }
.google-button-shell { position: relative; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; border-radius: 10px; }
.google-button-shell:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.google-button { position: relative; z-index: 2; width: 40px; height: 40px; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.google-button iframe { display: block; width: 40px !important; height: 40px !important; margin: 0 !important; border: 0 !important; }
.google-button.is-ready { opacity: 1; pointer-events: auto; }
.google-button-placeholder { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; border: 1px solid #747775; border-radius: 10px; background: #fff; pointer-events: none; }
.google-button-placeholder img { display: block; width: 24px; height: 24px; object-fit: contain; }
.google-button.is-ready + .google-button-placeholder { opacity: 1; visibility: visible; }
.apple-login-button { box-sizing: border-box; flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #747775; border-radius: 10px; color: #111; background: #fff; text-decoration: none; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.apple-login-button:hover { border-color: rgba(51,220,119,.58); background: #f7fbf8; transform: translateY(-1px); }
.apple-login-button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.apple-login-button img { display: block; width: 24px; height: 24px; object-fit: contain; }
.social-security { max-width: 420px; margin: 13px auto 0; color: #6f8177; text-align: center; font-size: 10px; line-height: 1.5; }
.security-note { display: flex; gap: 10px; align-items: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: #6f8177; }
.security-note span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #294a36; border-radius: 50%; color: var(--green); font-size: 10px; }
.security-note p { margin: 0; font-size: 11px; }
.app-downloads { margin-top: 18px; }
.app-downloads > p { margin: 0 0 9px; color: #6f8177; text-align: center; font-size: 9px; }
.app-store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.app-store-button { position: relative; min-width: 0; min-height: 50px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255, 255, 255, 0.025); text-decoration: none; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.app-store-button:hover { border-color: rgba(51, 220, 119, 0.38); background: rgba(51, 220, 119, 0.055); transform: translateY(-1px); }
.app-store-button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.store-icon { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; color: #dce6e0; }
.app-store-button small { display: block; overflow: hidden; color: #708379; font-size: 8px; letter-spacing: .06em; line-height: 1.1; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.app-store-button strong { display: block; margin-top: 2px; font-size: 11px; line-height: 1.1; white-space: nowrap; }
.auth-social-footer { display: flex; align-items: center; justify-content: center; gap: 11px; margin-top: 14px; color: #6f8177; font-size: 9px; }
.social-links { display: flex; align-items: center; gap: 11px; }
.social-links a { display: grid; place-items: center; width: 22px; height: 22px; color: #93a59b; text-decoration: none; transition: color 160ms ease, opacity 160ms ease, transform 160ms ease; }
.social-links a:hover { color: var(--green); transform: translateY(-1px); }
.social-links a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.social-links img { display: block; width: 18px; height: 18px; object-fit: contain; opacity: 0.7; filter: brightness(0) invert(1); }
.social-links a:hover img { opacity: 1; filter: brightness(0) saturate(100%) invert(71%) sepia(78%) saturate(736%) hue-rotate(86deg) brightness(91%) contrast(89%); }
.social-x { display: grid; place-items: center; width: 18px; height: 18px; color: currentColor; font-family: Arial, sans-serif; font-size: 15px; font-weight: 500; line-height: 1; }

.account-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.account-shell { width: min(100%, 1040px); }
.account-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.logout-button { padding: 11px 16px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: rgba(255,255,255,.035); cursor: pointer; }
.welcome-card { padding: clamp(34px, 7vw, 80px); border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(150deg, rgba(51,220,119,.08), transparent 40%), var(--panel); box-shadow: 0 35px 100px rgba(0,0,0,.25); }
.success-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 32px; border-radius: 18px; color: #041009; background: var(--green); font-size: 26px; font-weight: 900; }
.welcome-card h1 { margin: 16px 0; font-size: clamp(38px, 6vw, 68px); letter-spacing: -.055em; }
.welcome-card > p:not(.eyebrow) { max-width: 650px; color: var(--muted); line-height: 1.65; }
.next-module { margin-top: 44px; padding: 24px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.028); }
.next-module span { color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.next-module strong { margin-top: 4px; font-size: 20px; }
.next-module small { color: var(--muted); }
.link-button { width: fit-content; margin-top: 28px; padding: 0 24px; text-decoration: none; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { padding: 34px 22px 48px; }
  .form-wrap { width: min(100%, 520px); }
  .mobile-brand { display: flex; }
  .login-controls { top: 3px; }
}

@media (max-width: 480px) {
  .form-panel { place-items: start center; }
  .form-heading { margin-top: 25px; margin-bottom: 30px; }
  .form-heading h2 { font-size: 38px; }
  .field input, .submit-button { min-height: 56px; }
  .security-note { margin-top: 30px; align-items: flex-start; }
  .account-page { padding: 18px; }
  .account-nav .brand span { display: none; }
  .welcome-card { border-radius: 22px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f7f3;
  --panel: #ffffff;
  --panel-soft: #eaf3ed;
  --line: rgba(14, 62, 34, .14);
  --muted: #627369;
  --text: #102018;
  --green: #19b85b;
  --green-deep: #118a44;
  --danger: #c83f4a;
}
[data-theme="light"] body { background: radial-gradient(circle at 80% 8%, rgba(25,184,91,.1), transparent 28rem), var(--bg); }
[data-theme="light"] .brand-panel { background: linear-gradient(155deg, rgba(25,184,91,.14), transparent 42%), linear-gradient(180deg, #f7fbf8, #eaf4ed); }
[data-theme="light"] .brand-panel::after { border-color: rgba(17,138,68,.17); box-shadow: 0 0 0 70px rgba(25,184,91,.025), 0 0 0 140px rgba(25,184,91,.018); }
[data-theme="light"] .brand-copy p { color: #53675b; }
[data-theme="light"] .preview-card { border-color: rgba(14,62,34,.13); background: rgba(255,255,255,.7); box-shadow: 0 24px 70px rgba(19,75,43,.1); }
[data-theme="light"] .language-switch, [data-theme="light"] .theme-toggle, [data-theme="light"] .app-store-button { background: rgba(255,255,255,.72); }
[data-theme="light"] .language-switch button.is-active { background: #dcece2; }
[data-theme="light"] .field label { color: #344a3d; }
[data-theme="light"] .field input { background: rgba(255,255,255,.86); box-shadow: 0 8px 24px rgba(19,75,43,.035); }
[data-theme="light"] .field input::placeholder { color: #809087; }
[data-theme="light"] .field-leading-icon { color: #607a6b; }
[data-theme="light"] .two-factor { background: rgba(25,184,91,.065); }
[data-theme="light"] .form-message.is-info { color: #17683a; }
[data-theme="light"] .security-note, [data-theme="light"] .social-security, [data-theme="light"] .app-downloads > p, [data-theme="light"] .auth-social-footer { color: #61736a; }
[data-theme="light"] .store-icon { color: #33483c; }
[data-theme="light"] .social-links img { filter: brightness(0) saturate(100%) invert(44%) sepia(9%) saturate(768%) hue-rotate(97deg) brightness(94%) contrast(88%); opacity: .78; }
