/* ── Auth pages — HaulRank brand styles ─────────────────────────────────────
   Extends static/css/style.css (which sets the :root CSS variables).
   All colours reference those same variables so theme changes propagate here.
   ────────────────────────────────────────────────────────────────────────── */

/* Google Font — Inter (also loaded in base_auth.html) */
.auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ── Outer wrapper ── */
.auth-page {
  width: 100%;
  max-width: 440px;
}

/* ── Logo block ── */
.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo-link {
  text-decoration: none;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.logo-haul  { color: #ffffff; }
.logo-rank  { color: #3B82F6; }
.auth-logo-tagline {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mu);
  margin-top: .35rem;
}

/* ── Flash alerts ── */
.auth-alert {
  border-radius: 8px;
  padding: .65rem 1rem;
  font-size: .82rem;
  margin-bottom: .875rem;
  border: 1px solid;
}
.auth-alert-error {
  background: var(--hbg);
  border-color: var(--hbd);
  color: #f87171;
}
.auth-alert-success {
  background: #052e16;
  border-color: #166534;
  color: #4ade80;
}
.auth-alert-info {
  background: #0c1a3d;
  border-color: #1e3a8a;
  color: #93c5fd;
}

/* ── Card ── */
.auth-card {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 40px rgba(0,0,0,.45);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tx);
  margin: 0 0 .3rem;
}
.auth-card-subtitle {
  font-size: .82rem;
  color: var(--mu);
  margin: 0;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.auth-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  font-weight: 500;
  color: var(--tx);
}
.auth-label-link {
  font-size: .75rem;
  color: var(--ac);
  text-decoration: none;
  font-weight: 400;
}
.auth-label-link:hover { text-decoration: underline; }
.auth-optional { color: var(--mu); font-weight: 400; font-size: .72rem; }
.auth-required { color: var(--ac); }

.auth-input {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: .7rem 1rem;
  color: var(--tx);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.auth-input:focus { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(79,110,247,.15); }
.auth-input::placeholder { color: var(--mu); }

/* ── Primary button ── */
.auth-btn-primary {
  width: 100%;
  background: #3B82F6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .8rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-top: .25rem;
}
.auth-btn-primary:hover  { background: #2563EB; }
.auth-btn-primary:active { transform: scale(.99); }
.auth-btn-primary:disabled {
  background: var(--s2);
  color: var(--mu);
  cursor: not-allowed;
  transform: none;
}

/* ── Footer text ── */
.auth-footer-text {
  text-align: center;
  font-size: .8rem;
  color: var(--mu);
  margin-top: 1.25rem;
}
.auth-link {
  color: var(--ac);
  text-decoration: none;
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

/* ── Role picker cards (sign-up page) ── */
.auth-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: .2rem;
}
.auth-role-card {
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 1.1rem .875rem;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, transform .1s;
  color: var(--tx);
  font-family: inherit;
  position: relative;
}
.auth-role-card:hover {
  border-color: var(--ac);
  background: rgba(79,110,247,.06);
}
.auth-role-card.selected {
  border-color: #3B82F6;
  background: rgba(59,130,246,.12);
  box-shadow: 0 0 0 1px #3B82F6;
}
.auth-role-card.selected::after {
  content: '✓';
  position: absolute;
  top: .5rem;
  right: .65rem;
  font-size: .75rem;
  color: #3B82F6;
  font-weight: 700;
}
.auth-role-icon {
  font-size: 1.75rem;
  margin-bottom: .35rem;
  line-height: 1;
}
.auth-role-name {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .25rem;
}
.auth-role-desc {
  font-size: .68rem;
  color: var(--mu);
  line-height: 1.45;
}
.auth-role-error {
  font-size: .75rem;
  color: #f87171;
  margin-top: .25rem;
}
/* auth-hidden is used ONLY inside auth form templates to hide elements.
   We do NOT override the global .hidden class here — that belongs to
   style.css and is used by app.js to show/hide sections of index.html. */
.auth-hidden { display: none; }

/* ── App header user info bar (shown on index.html when logged in) ── */
.user-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .75rem;
  color: var(--mu);
}
.user-bar-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  color: var(--tx);
  font-weight: 500;
}
.user-bar-role {
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ac);
}
.user-bar-logout {
  color: var(--mu);
  text-decoration: none;
  font-size: .75rem;
  border: 1px solid var(--bd);
  border-radius: 6px;
  padding: .25rem .65rem;
  transition: border-color .15s, color .15s;
}
.user-bar-logout:hover { border-color: var(--ac); color: var(--tx); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-card { padding: 1.5rem 1.25rem; }
  .auth-role-grid { grid-template-columns: 1fr; }
  .auth-logo-link { font-size: 1.5rem; }
}

/* Google Sign-in button */
.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
  box-sizing: border-box;
  margin-top: .25rem;
}
.auth-btn-google:hover {
  background: #f8f9fa;
  border-color: #d2d4d7;
}
.auth-btn-google:active {
  transform: scale(.99);
}

/* Visual divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--mu);
  font-size: 0.75rem;
  margin: 1.25rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--bd);
}
.auth-divider:not(:empty)::before {
  margin-right: .75rem;
}
.auth-divider:not(:empty)::after {
  margin-left: .75rem;
}

