:root {
  --auth-bg: #eef3fb;
  --auth-surface: #ffffff;
  --auth-line: #d7e1ef;
  --auth-line-strong: #b7c7e3;
  --auth-text: #13203a;
  --auth-muted: #5c6d8d;
  --auth-brand: #0050c8;
  --auth-brand-strong: #00398f;
  --auth-google: #ffffff;
  --auth-danger-bg: #fee9e8;
  --auth-danger-text: #a22a1a;
  --auth-danger-line: #f5beb8;
  --auth-warning-bg: #fff4dc;
  --auth-warning-text: #7b5100;
  --auth-warning-line: #f1d7a5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--auth-text);
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(0, 80, 200, 0.14), transparent 45%),
    radial-gradient(circle at 88% 16%, rgba(0, 57, 143, 0.16), transparent 42%),
    linear-gradient(180deg, #f6f9ff 0%, var(--auth-bg) 100%);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 38px);
}

.auth-wrap {
  width: min(640px, 100%);
  margin: 0 auto;
}

.auth-wrap-login {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 22px;
}

.auth-story {
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: clamp(26px, 4vw, 42px);
  overflow: hidden;
  color: #e7f0ff;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(145deg, #00338f 0%, #0048b6 45%, #0066d6 100%);
  box-shadow: 0 28px 50px rgba(4, 26, 74, 0.28);
}

.auth-story::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: -70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.auth-stage {
  border-radius: 28px;
  border: 1px solid var(--auth-line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 40px rgba(24, 56, 111, 0.14);
  padding: clamp(24px, 4vw, 36px);
  text-align: left;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: 14px;
}

.auth-brand-story {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(236, 244, 255, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 24px rgba(2, 23, 70, 0.22);
}

.auth-logo {
  display: block;
  height: clamp(40px, 4vw, 56px);
  width: auto;
}

.auth-brand-story .auth-logo {
  height: clamp(34px, 3.2vw, 46px);
}

.story-kicker {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #d9e8ff;
  letter-spacing: 0.04em;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.story-title {
  margin: 18px 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.story-copy {
  margin: 0;
  color: rgba(233, 241, 255, 0.9);
  font-size: 17px;
  line-height: 1.65;
  max-width: 44ch;
}

.story-points {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.story-points li {
  position: relative;
  padding-left: 28px;
  color: #eff5ff;
  font-size: 16px;
  font-weight: 500;
}

.story-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5ab2ff;
  box-shadow: 0 0 0 4px rgba(90, 178, 255, 0.25);
}

.auth-kicker {
  margin: 0 0 8px;
  color: var(--auth-brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-title {
  margin: 0 0 18px;
  color: #0e2348;
  font-size: clamp(30px, 3.1vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.auth-subcopy {
  margin: 0 0 18px;
  color: #576b8d;
  font-size: 15px;
  line-height: 1.7;
  max-width: 52ch;
}

.auth-progress-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.progress-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d7e2f2;
  background: #f7faff;
  color: #5d7396;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-chip.active {
  border-color: rgba(0, 80, 200, 0.24);
  background: rgba(0, 80, 200, 0.08);
  color: var(--auth-brand);
}

.google-btn {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--auth-line-strong);
  border-radius: 14px;
  background: var(--auth-google);
  color: #12325e;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.google-btn:hover,
.google-btn:focus-visible {
  transform: translateY(-1px);
  border-color: #7ea7e4;
  box-shadow: 0 10px 18px rgba(31, 67, 128, 0.14);
}

.google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.google-mark {
  width: 64px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--auth-line);
  color: #db4437;
  font-size: 24px;
  font-weight: 700;
}

.google-btn span:last-child {
  padding: 0 16px;
}

.divider {
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #6f7f99;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--auth-line);
  flex: 1;
}

.auth-card {
  background: var(--auth-surface);
  border-radius: 18px;
  border: 1px solid var(--auth-line);
  padding: 18px;
}

.auth-card-advanced {
  padding: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-method-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid #d9e3f4;
  border-radius: 18px;
  background: #f5f8fe;
}

.auth-method-btn {
  min-height: 46px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #5d7396;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.auth-method-btn.active {
  background: #ffffff;
  color: #0e2348;
  box-shadow: 0 8px 18px rgba(18, 47, 99, 0.1);
}

.auth-step-panel {
  border-top: 1px solid #e4ebf6;
  padding-top: 16px;
}

.auth-status-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #1d3053;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #cbd8ec;
  border-radius: 12px;
  background: #ffffff;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 500;
  color: #14264a;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.field input::placeholder {
  color: #8a9ab6;
}

.field input:focus {
  outline: none;
  border-color: #5f8fd9;
  box-shadow: 0 0 0 3px rgba(95, 143, 217, 0.18);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: #7a8eaf;
}

.row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #425878;
}

.check-wrap input,
.consent-wrap input {
  width: 16px;
  height: 16px;
}

.row-inline a,
.consent-wrap a,
.switch-copy a {
  color: var(--auth-brand);
  text-decoration: none;
  font-weight: 600;
}

.row-inline a:hover,
.consent-wrap a:hover,
.switch-copy a:hover {
  text-decoration: underline;
}

.consent-wrap {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: #425878;
}

.helper-copy {
  margin: 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

.helper-copy.small {
  margin-top: 8px;
  text-align: center;
}

.auth-google-shell {
  margin-top: 18px;
}

.panel-kicker {
  margin: 0 0 6px;
  color: var(--auth-brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-title {
  margin: 0;
  color: #0f2246;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.panel-copy {
  margin: 10px 0 0;
  color: #5b6f90;
  font-size: 15px;
  line-height: 1.7;
}

.purchase-panel,
.otp-header {
  display: grid;
  gap: 14px;
}

.purchase-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.purchase-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-inline-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--auth-brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible {
  text-decoration: underline;
}

.auth-email-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  border: 1px solid #d6e2f4;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7faff 0%, #edf4ff 100%);
  padding: 0 16px;
}

.auth-email-label {
  color: #6980a3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#lockedEmailLabel {
  color: #0d2550;
  font-size: 15px;
  font-weight: 700;
  word-break: break-word;
}

.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.otp-slot {
  width: 100%;
  min-height: 60px;
  border: 1px solid #cfdcf1;
  border-radius: 16px;
  background: #ffffff;
  text-align: center;
  color: #0f2145;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.otp-slot:focus {
  outline: none;
  border-color: #4f85d7;
  box-shadow: 0 0 0 4px rgba(79, 133, 215, 0.16);
  transform: translateY(-1px);
}

.dual-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.submit-btn {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--auth-brand) 0%, #0f73dc 58%, #1b8de9 100%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.submit-btn:hover,
.submit-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(12, 73, 154, 0.26);
}

.submit-btn.alt {
  background: #eaf1ff;
  color: #0c367a;
  border: 1px solid #c6d7f6;
}

.submit-btn.alt:hover,
.submit-btn.alt:focus-visible {
  box-shadow: 0 8px 14px rgba(23, 66, 137, 0.16);
}

.status-error,
.status-warning {
  margin: 0 0 12px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.status-error {
  background: var(--auth-danger-bg);
  color: var(--auth-danger-text);
  border: 1px solid var(--auth-danger-line);
}

.status-warning {
  background: var(--auth-warning-bg);
  color: var(--auth-warning-text);
  border: 1px solid var(--auth-warning-line);
}

.status-success {
  margin: 0 0 12px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  background: #e8f7ee;
  color: #17663a;
  border: 1px solid #b9e3c8;
}

.switch-copy {
  margin: 16px 0 0;
  color: #445978;
  font-size: 14px;
  text-align: center;
}

.verify-wrap {
  max-width: 620px;
}

.resend-form {
  margin-top: 10px;
}

.ghost-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #c6d7f6;
  background: #f3f7ff;
  color: #11408a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  background: #e8f0ff;
}

@media (max-width: 1024px) {
  .auth-wrap-login {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .auth-story {
    padding: 22px;
  }

  .story-title {
    font-size: clamp(26px, 7vw, 36px);
  }

  .auth-stage {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .auth-page {
    padding: 14px;
  }

  .auth-story,
  .auth-stage,
  .auth-card {
    border-radius: 16px;
  }

  .auth-stage {
    padding: 16px;
  }

  .auth-title {
    font-size: 28px;
  }

  .panel-title {
    font-size: 24px;
  }

  .otp-grid {
    gap: 8px;
  }

  .otp-slot {
    min-height: 52px;
    font-size: 20px;
  }

  .google-mark {
    width: 56px;
  }

  .story-points li {
    font-size: 14px;
  }

  .row-inline {
    align-items: flex-start;
    flex-direction: column;
  }
}
