/* ── Custom properties ───────────────────────────────────── */
:root {
  --red:     #db0a40;
  --bg:      #f4f4f5;
  --card:    #ffffff;
  --text:    #1a1a1a;
  --muted:   #888;
  --border:  #c9cace;
  --input-bg:#fafafa;
  --shadow:  0 4px 24px rgba(0, 0, 0, .08);
  --radius:  8px;
  --font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ────────────────────────────────────────────────── */
html, body { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 16px 48px;
}

/* ── Logo ────────────────────────────────────────────────── */
.logo {
  display: block;
  height: 124px;
  min-height: 60px;
  margin: 0 auto 40px;
  cursor: pointer;
}
.logo img {
  display: block;
  height: 100%;
  width: auto;
  margin: 0 auto;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  width: 100%;
  max-width: 450px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  line-height: 1.4;
}

.btn-primary              { background: var(--red);  color: #fff;        border-color: var(--red); }
.btn-primary:hover        { background: #b5082f;     border-color: #b5082f; }

.btn-outline              { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover        { background: #f0f0f0; }

.btn-icon {
  height: 18px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* ── Section label ───────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── OR divider ──────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.divider::before,
.divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Alert ───────────────────────────────────────────────── */
.alert {
  display: none;
  align-items: baseline;
  gap: 7px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 2px 0;
}
.alert::before {
  content: '';
  flex-shrink: 0;
  display: inline-block;
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
  top: 2px;
}
.alert a { text-decoration: underline; color: inherit; }

.alert-danger {
  color: #c0392b;
}
.alert-danger::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23c0392b'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.alert-info {
  color: #1a56a0;
}
.alert-info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231a56a0'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zm-1 9V9a1 1 0 112 0v5a1 1 0 11-2 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.alert-success {
  color: #1e7e34;
}
.alert-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231e7e34'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* ── Form ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-control {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.form-control:focus {
  border-color: #1a73e8;
  background: #fff;
}

/* ── Autofill override (suppress browser blue/yellow bg) ─── */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--text);
}

/* ── Floating label field (notch style) ──────────────────── */
.field {
  position: relative;
  margin-bottom: 14px;
}

.field input {
  display: block;
  width: 100%;
  padding: 16px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color .2s;
}

.field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  padding: 0 4px;
  background: transparent;
  transition: top .18s ease, font-size .18s ease, color .18s ease;
}

/* Label rides up onto the border line, white bg cuts a notch through it */
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 12px;
  background: #fff;
}

.field input:focus + label { color: #1a73e8; }
.field input:focus         { border-color: #1a73e8; }

/* ── Form actions ────────────────────────────────────────── */
.form-actions {
  margin-top: 24px;
}

/* Inline CSS spinner inside the button */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.btn-outline .btn-spinner {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--text);
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* Legacy GIF spinner — hidden; kept for non-_new pages */
.spinner { display: none; }

/* ── Forgot password link ────────────────────────────────── */
.forgot-link {
  display: block;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  color: #1a73e8;
  text-decoration: none;
  transition: color .15s;
}
.forgot-link:hover { color: #1558b0; }

/* ── Sign-up line ────────────────────────────────────────── */
.signup-link {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.signup-link a {
  color: #1a73e8;
  text-decoration: none;
  transition: color .15s;
}
.signup-link a:hover { color: #1558b0; }

/* ── Card heading + subtitle ─────────────────────────────── */
.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.card-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Label above non-floating fields (select) ────────────── */
.form-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ── Form group spacing ──────────────────────────────────── */
.form-group { margin-bottom: 14px; }

/* ── Checkbox rows ───────────────────────────────────────── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.form-check input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.form-check a { color: #1a73e8; text-decoration: none; }
.form-check a:hover { color: #1558b0; }

/* ── Horizontal rule ─────────────────────────────────────── */
.divider-line { border: none; border-top: 1px dotted var(--border); margin: 18px 0; }

/* ── Helper / hint text ──────────────────────────────────── */
.explain-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 12px 0;
}

/* ── Wide card (signup) ──────────────────────────────────── */
.card-wide { max-width: 560px; }

/* ── Platform notice ─────────────────────────────────────── */
.platform-notice {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dotted var(--border);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: 28px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 2.2;
  max-width: 580px;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.sep { margin: 0 4px; opacity: .4; }

/* ── Password strength checklist ────────────────────────── */
.pw-strength {
  display: flex;
  gap: 20px;
  margin: 4px 0 16px;
  font-size: 12px;
}
.pw-rule { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.pw-icon { font-style: normal; color: #e53935; }
.pw-rule.met .pw-icon { color: #2e7d32; }

/* ── Dark mode ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0d0d0d;
    --card:    #1a1a1a;
    --text:    #e0e0e0;
    --muted:   #666;
    --border:  #333;
    --input-bg:#222;
    --shadow:  0 4px 32px rgba(0, 0, 0, .5);
  }

  .form-control:focus { background: #1e1e1e; color: #666666; }

  .field input                                    { background: #1e1e1e; color: #e0e0e0; border-color: #444; }
  .field input:-webkit-autofill,
  .field input:-webkit-autofill:hover,
  .field input:-webkit-autofill:focus            { -webkit-box-shadow: 0 0 0 1000px #1e1e1e inset; -webkit-text-fill-color: #e0e0e0; }
  .field input:focus                              { border-color: #1a73e8; }
  .field input:focus + label                      { color: #1a73e8; }
  .field input:focus + label,
  .field input:not(:placeholder-shown) + label   { background: #1e1e1e; }

  .form-control {
    background: #1e1e1e;
    color: #666666;
  }

  .pw-rule            { color: #666666; }

  .btn-outline              { color: #e0e0e0; border-color: #333; }
  .btn-outline:hover        { background: #252525; }

  .alert-danger  { background: #3b1010; border-color: #a02010; color: #f0c0b0; }
  .alert-info    { background: #0d1e3d; border-color: #2a50a0; color: #b0c8f0; }
  .alert-success { background: #0d2e14; border-color: #1a6030; color: #a0d0a8; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 440px) {
  .card { padding: 30px 20px; }
  .form-links { flex-direction: column; gap: 8px; align-items: center; }
}
