:root {
  --forest-950: #072d26;
  --forest-900: #0b3b32;
  --forest-800: #10493d;
  --forest-700: #176253;
  --mint: #4fdcbd;
  --mint-soft: #e6f9f4;
  --canvas: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #182520;
  --muted: #6d7b75;
  --subtle: #94a09b;
  --line: #e0e8e4;
  --line-strong: #cedbd5;
  --danger: #c94f4f;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 55px rgba(23, 48, 39, .09);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 8%, rgba(79, 220, 189, .12), transparent 25%),
    var(--canvas);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, label { -webkit-tap-highlight-color: transparent; }

.login-page { min-height: 100vh; }
.login-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
}
.login-brand { display: inline-flex; align-items: center; gap: 11px; }
.login-brand img { width: 40px; height: 40px; border-radius: 12px; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { color: var(--forest-900); font-size: .78rem; font-weight: 700; letter-spacing: .15em; }
.login-brand span { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.login-top-actions { display: flex; align-items: center; gap: 12px; }
.login-top-actions > span { color: var(--muted); font-size: .67rem; }
.join-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--forest-900);
  background: #fff;
  font-size: .66rem;
  font-weight: 650;
}
.join-link:hover { border-color: var(--line-strong); background: var(--mint-soft); }

.login-layout {
  width: min(1180px, calc(100% - 48px));
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(440px, .94fr);
  gap: 18px;
  align-items: stretch;
  margin: 34px auto;
}
.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 42px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 95% 2%, rgba(79,220,189,.24), transparent 30%),
    linear-gradient(145deg, var(--forest-900), var(--forest-950));
  box-shadow: var(--shadow);
}
.login-intro::after {
  content: "";
  position: absolute;
  right: -115px;
  bottom: -150px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018);
}
.intro-eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--mint);
  font-size: .61rem;
  font-weight: 650;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.intro-eyebrow i { font-size: .61rem; }
.login-intro h1 {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin: 27px 0 18px;
  font-size: clamp(2.7rem, 4.7vw, 4.55rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 650;
}
.login-intro > p {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0;
  color: rgba(255,255,255,.67);
  font-size: .9rem;
  line-height: 1.65;
}

.workspace-preview {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
}
.preview-topline {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.preview-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--mint); background: rgba(79,220,189,.1); font-size: .78rem; }
.preview-topline strong, .preview-topline span { display: block; }
.preview-topline strong { font-size: .7rem; font-weight: 600; }
.preview-topline div > span { margin-top: 3px; color: rgba(255,255,255,.5); font-size: .58rem; }
.live-chip { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid rgba(79,220,189,.18); border-radius: 99px; color: rgba(255,255,255,.7); background: rgba(79,220,189,.08); font-size: .54rem; }
.live-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(79,220,189,.08); }
.preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.preview-grid article { min-height: 108px; padding: 13px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; background: rgba(255,255,255,.03); }
.preview-grid article > i { color: var(--mint); font-size: .74rem; }
.preview-grid strong, .preview-grid span { display: block; }
.preview-grid strong { margin-top: 16px; font-size: .65rem; font-weight: 600; }
.preview-grid span { margin-top: 4px; color: rgba(255,255,255,.45); font-size: .54rem; line-height: 1.42; }
.security-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 25px;
  color: rgba(255,255,255,.55);
  font-size: .6rem;
  line-height: 1.45;
}
.security-note i { color: var(--mint); }

.login-form-panel {
  display: flex;
  flex-direction: column;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 5px 22px rgba(23,48,39,.04);
}
.back-link { display: inline-flex; align-items: center; gap: 7px; width: fit-content; color: var(--muted); font-size: .62rem; font-weight: 550; }
.back-link:hover { color: var(--forest-900); }
.form-heading { margin: 72px 0 30px; }
.form-heading-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 11px; color: var(--forest-700); background: var(--mint-soft); }
.form-heading h2 { margin: 0; color: var(--text); font-size: clamp(1.9rem, 3vw, 2.45rem); line-height: 1.03; letter-spacing: -.045em; font-weight: 650; }
.form-heading p { max-width: 420px; margin: 9px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }

.login-form, .reset-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field-label { display: block; color: #485851; font-size: .65rem; font-weight: 600; }
.input-shell {
  min-height: 48px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input-shell:focus-within { border-color: #8fd6c5; background: #fff; box-shadow: 0 0 0 3px rgba(79,220,189,.12); }
.input-shell > i { color: var(--subtle); font-size: .73rem; }
.form-input { width: 100%; height: 46px; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .72rem; font-weight: 450; }
.form-input::placeholder { color: #9aa69f; }
.password-toggle { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--subtle); background: transparent; cursor: pointer; }
.password-toggle:hover { color: var(--forest-900); background: var(--mint-soft); }

.form-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: -2px; }
.remember-option { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .61rem; cursor: pointer; }
.remember-option input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; color: transparent; background: var(--surface-soft); transition: .16s ease; }
.check-box i { font-size: .52rem; }
.remember-option input:checked + .check-box { border-color: var(--forest-700); color: #fff; background: var(--forest-700); }
.remember-option input:focus-visible + .check-box { box-shadow: 0 0 0 3px rgba(79,220,189,.2); }
.forgot-link { padding: 0; border: 0; color: var(--forest-700); background: transparent; font-size: .61rem; font-weight: 650; cursor: pointer; }
.forgot-link:hover { text-decoration: underline; }
.submit-button {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--forest-900);
  font-size: .68rem;
  font-weight: 650;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.submit-button:hover { background: var(--forest-800); transform: translateY(-1px); }
.submit-button:disabled { opacity: .64; cursor: wait; transform: none; }
.security-caption { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -4px 0 0; color: var(--subtle); font-size: .55rem; line-height: 1.45; text-align: center; }
.security-caption i { color: var(--forest-700); }
.form-footer { margin: auto 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .62rem; text-align: center; }
.form-footer a { color: var(--forest-700); font-weight: 650; }

.modal-overlay { position: fixed; z-index: 1000; inset: 0; display: none; place-items: center; padding: 18px; background: rgba(7,35,29,.48); backdrop-filter: blur(10px); }
.modal-overlay.show { display: grid; }
.modal-card { position: relative; width: min(400px, 100%); padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.modal-form-card { width: min(430px, 100%); text-align: left; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; }
.modal-close:hover { color: var(--forest-900); background: var(--mint-soft); }
.modal-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 12px; }
.modal-form-card .modal-icon { margin-left: 0; }
.modal-icon.success { color: var(--forest-700); background: var(--mint-soft); }
.modal-icon.error { color: var(--danger); background: var(--danger-soft); }
.modal-card h3 { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -.025em; }
.modal-card > p { margin: 7px 0 19px; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.modal-button { width: 100%; min-height: 42px; border: 0; border-radius: 9px; color: #fff; background: var(--forest-900); font-size: .65rem; font-weight: 650; cursor: pointer; }
.reset-form { gap: 14px; }

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 570px; padding: 34px; }
  .login-intro h1 { max-width: 680px; font-size: clamp(2.5rem, 8vw, 4.1rem); }
  .login-form-panel { min-height: 580px; }
  .form-heading { margin-top: 42px; }
}

@media (max-width: 640px) {
  .login-topbar { min-height: 64px; padding: 0 16px; }
  .login-brand img { width: 36px; height: 36px; }
  .login-brand span, .login-top-actions > span { display: none; }
  .login-layout { width: min(100% - 24px, 560px); min-height: 0; gap: 12px; margin: 12px auto 20px; }
  .login-intro { min-height: auto; padding: 25px 20px; border-radius: 16px; }
  .login-intro h1 { margin: 20px 0 13px; font-size: clamp(2.25rem, 12vw, 3.25rem); }
  .login-intro > p { font-size: .77rem; }
  .workspace-preview { margin-top: 23px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-grid article { min-height: auto; display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; align-items: center; }
  .preview-grid strong { margin-top: 0; }
  .preview-grid span { grid-column: 2; margin-top: 1px; }
  .security-note { margin-top: 20px; }
  .login-form-panel { min-height: 540px; padding: 23px 18px; border-radius: 16px; }
  .form-heading { margin: 31px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
