/* Shared styles for the sign in / sign up / password pages.
   Matches the look of index.html. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 100%, #ff6b3d 0%, transparent 70%),
    radial-gradient(ellipse 55% 50% at 30% 85%, #ff3d8b 0%, transparent 70%),
    radial-gradient(ellipse 55% 50% at 72% 80%, #6b5bff 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 60%, #2a4bff 0%, transparent 75%);
  filter: blur(40px);
  opacity: var(--glow-opacity);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-3%) scale(1.05); }
}

header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.header-link { font-size: 14px; color: var(--muted); }
.header-link a { color: var(--text); text-decoration: none; font-weight: 500; margin-left: 4px; }
.header-link a:hover { text-decoration: underline; }

main {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 80px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--box);
  border: 1px solid var(--box-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 60px var(--shadow);
}
.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--chip); border: 1px solid var(--box-border);
  margin-bottom: 20px; color: var(--text);
}
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.sub { font-size: 15px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.sub b { color: var(--text); font-weight: 500; }

/* Social sign-in buttons */
.social { display: flex; flex-direction: column; gap: 10px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 44px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--field-border);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.social-btn:hover { background: var(--field-hover); border-color: var(--strong-border); }
.social-btn svg { width: 18px; height: 18px; flex: none; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--box-border); }

/* Form fields */
form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
label { font-size: 13px; font-weight: 500; color: var(--muted); }
.label-row a { font-size: 13px; color: var(--muted); text-decoration: none; }
.label-row a:hover { color: var(--text); }
.input-wrap { position: relative; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--field); border: 1px solid var(--field-border); border-radius: 12px;
  color: var(--text); font: inherit; font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap input { padding-right: 44px; }
input::placeholder { color: var(--faint); }
input:focus { border-color: var(--strong-border); box-shadow: 0 0 0 3px var(--focus-ring); }
input.invalid { border-color: var(--error); }
.toggle-pw {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  color: var(--faint); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.toggle-pw:hover { color: var(--text); background: var(--chip); }
.hint { font-size: 12px; color: var(--faint); }
.error-msg { font-size: 12px; color: var(--error); display: none; }
.error-msg.show { display: block; }

/* Password strength meter */
.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength span { flex: 1; height: 3px; border-radius: 2px; background: var(--box-border); transition: background .2s; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.check input { margin-top: 2px; accent-color: var(--text); width: 16px; height: 16px; flex: none; }
.check a { color: var(--text); }

.submit {
  height: 44px; border-radius: 12px; border: 0; margin-top: 4px;
  background: var(--text); color: var(--on-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.submit:hover { opacity: 0.92; }
.submit:active { transform: scale(0.99); }
.submit:disabled { opacity: 0.4; cursor: default; }

.alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 22px; }
.alt a { color: var(--text); text-decoration: none; font-weight: 500; }
.alt a:hover { text-decoration: underline; }
.back { display: inline-flex; align-items: center; gap: 6px; }

.legal { text-align: center; font-size: 12px; color: var(--faint); margin-top: 18px; line-height: 1.5; }
.legal a { color: var(--muted); }

/* Success state (forgot / reset password) */
.success { display: none; text-align: center; }
.success .card-icon { margin: 0 auto 20px; color: var(--ok); }
.done .form-state { display: none; }
.done .success { display: block; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--toast-bg); color: var(--toast-text); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; transition: all .25s; z-index: 10; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 480px) {
  header { padding: 14px 16px; }
  .header-link span { display: none; }
  .card { padding: 24px 20px; border-radius: 20px; }
}
