:root {
  --auth-bg: #080C12;
  --auth-surface: rgba(255, 255, 255, 0.11);
  --auth-surface-hover: rgba(255, 255, 255, 0.15);
  --auth-border: rgba(255, 255, 255, 0.22);
  --auth-border-focus: #ECC97E;
  --auth-accent: #ECC97E;
  --auth-accent-dim: rgba(236, 201, 126, 0.2);
  --auth-text: #FFFFFF;
  --auth-text-soft: rgba(255, 255, 255, 0.82);
  --auth-text-muted: rgba(255, 255, 255, 0.62);
  --auth-danger: #FF7070;
  --auth-danger-bg: rgba(239, 68, 68, 0.1);
  --auth-danger-border: rgba(239, 68, 68, 0.25);
  --auth-success: #4ade80;
  --auth-success-bg: rgba(74, 222, 128, 0.1);
  --auth-success-border: rgba(74, 222, 128, 0.25);
  --auth-transition: 0.2s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.auth-body {
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--auth-text);
  background: var(--auth-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Nav ── */
.auth-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(24, 29, 40, 0.97);
  backdrop-filter: blur(16px);
}

.auth-nav-logo {
  width: 90px;
  height: 30px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.auth-nav-link {
  color: var(--auth-text-soft);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color var(--auth-transition);
}

.auth-nav-link:hover {
  color: var(--auth-text);
}

/* ── Main layout ── */
.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 48px;
}

/* ── Card ── */
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 32px;
  border-radius: 20px;
  background: #141C28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 40px 80px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(236, 201, 126, 0.7) 0%, rgba(236, 201, 126, 0.15) 60%, transparent 100%);
}

.auth-card-wide {
  max-width: 720px;
}

/* ── Logo in card ── */
.auth-card-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-card-logo-img {
  width: 110px;
  height: 36px;
  object-fit: contain;
  display: block;
}

/* ── Card heading ── */
.auth-kicker {
  margin: 0 0 8px;
  color: var(--auth-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
}

.auth-card-title {
  margin: 0 0 6px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-align: center;
}

.auth-card-subtitle {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-form-actions {
  display: grid;
  gap: 16px;
  padding-top: 6px;
}

/* ── Field ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field-optional {
  color: var(--auth-text-muted);
  font-weight: 400;
}

.field-group input {
  width: 100%;
  min-height: 46px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: var(--auth-text);
  font: inherit;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition), background var(--auth-transition);
}

.field-group input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.field-group input:focus {
  outline: none;
  border-color: rgba(240, 207, 130, 0.5);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(236, 201, 126, 0.16);
}

.helper {
  color: var(--auth-text-muted);
  font-size: 0.76rem;
  line-height: 1.55;
  margin: 0;
}

/* ── Submit button ── */
.auth-submit {
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  margin: 0;
  border: none;
  border-radius: 12px;
  background: #ECC97E;
  color: #0d1117;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(236, 201, 126, 0.28);
  transition: transform var(--auth-transition), box-shadow var(--auth-transition), opacity var(--auth-transition);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(236, 201, 126, 0.38);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Error / success ── */
.error {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--auth-danger-bg);
  border: 1px solid var(--auth-danger-border);
  color: var(--auth-danger);
  font-size: 0.84rem;
  line-height: 1.55;
}

.error.success {
  background: var(--auth-success-bg);
  border-color: var(--auth-success-border);
  color: var(--auth-success);
}

.error:empty {
  display: none;
}

/* ── Signup message ── */
.auth-message {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--auth-danger-border);
  border-radius: 12px;
  background: var(--auth-danger-bg);
}

.auth-message[hidden] {
  display: none;
}

.auth-message-title {
  margin: 0;
  color: var(--auth-danger);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
}

.auth-message-body {
  margin: 0;
  color: rgba(248, 113, 113, 0.8);
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-action-link,
.message-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity var(--auth-transition);
}

.message-action-link {
  background: #ECC97E;
  color: #0d1117;
}

.message-action-button {
  border: 1px solid var(--auth-danger-border);
  background: transparent;
  color: var(--auth-danger);
  cursor: pointer;
}

.message-action-link:hover,
.message-action-button:hover {
  opacity: 0.85;
}

/* ── Checkbox ── */
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.auth-checkbox input {
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--auth-accent);
}

.auth-checkbox span {
  color: var(--auth-text-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.auth-checkbox a {
  color: var(--auth-accent);
  font-weight: 600;
}

/* ── Links below form ── */
.auth-links {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-links p {
  margin: 0;
  color: var(--auth-text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}

.auth-links a {
  color: var(--auth-accent);
  font-weight: 600;
  transition: opacity var(--auth-transition);
}

.auth-links a:hover {
  opacity: 0.8;
}

.auth-disclaimer {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.76rem !important;
}

/* ── Trial text ── */
#trial-text {
  display: block;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Loading state ── */
.loading {
  opacity: 0.72;
  pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .auth-nav {
    padding: 12px 16px;
  }

  .auth-main {
    padding: 88px 16px 40px;
    align-items: flex-start;
  }

  .auth-card {
    padding: 30px 22px 26px;
  }

  .auth-card-wide {
    max-width: 100%;
  }

  .auth-form-row {
    grid-template-columns: 1fr;
  }

  .auth-card-title {
    font-size: 22px;
  }
}
