/* ==========================================================================
   SATHUB - SHARED AUTH PAGE STYLES (Login + Register)
   Light, modern theme. Accent color pulled from the landing page's gold.
   ========================================================================== */

:root {
  --auth-bg-start: #f4f6fb;
  --auth-bg-end: #eef1f8;
  --auth-navy: #0A0E27;
  --auth-gold: #f9d423;
  --auth-gold-dark: #d4ab00;
  --auth-text: #1e2433;
  --auth-text-muted: #6b7280;
  --auth-border: #e5e7eb;
  --auth-field-bg: #f9fafb;
  --auth-error: #dc2626;
  --auth-error-bg: #fef2f2;
  --auth-success: #16a34a;
  --auth-success-bg: #f0fdf4;
  --auth-radius: 18px;
}

* {
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--auth-text);
  background: radial-gradient(1200px 600px at 15% -10%, rgba(249, 212, 35, 0.14), transparent 60%),
              radial-gradient(1000px 500px at 110% 10%, rgba(10, 14, 39, 0.06), transparent 55%),
              linear-gradient(180deg, var(--auth-bg-start), var(--auth-bg-end));
  display: flex;
  flex-direction: column;
}

/* --- TOP BRAND BAR --- */
.auth-topbar {
  padding: 24px 32px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.auth-brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--auth-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--auth-navy);
  flex-shrink: 0;
}

.auth-brand-name {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--auth-navy);
  letter-spacing: 0.5px;
  line-height: 1;
}

.auth-brand-tag {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--auth-gold-dark);
  margin-top: 3px;
}

/* --- MAIN WRAPPER --- */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 60px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 45px rgba(10, 14, 39, 0.08);
}

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

.auth-card-header {
  text-align: center;
  margin-bottom: 26px;
}

.auth-badge {
  display: inline-block;
  color: var(--auth-gold-dark);
  background: rgba(249, 212, 35, 0.16);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}

.auth-card-header h2 {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--auth-navy);
  margin: 12px 0 0;
}

.auth-card-header p {
  color: var(--auth-text-muted);
  font-size: 0.92rem;
  margin: 8px 0 0;
}

/* --- FORM --- */
.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.auth-field-group {
  margin-bottom: 18px;
}

.auth-field-group label,
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--auth-text-muted);
  text-transform: uppercase;
  margin-bottom: 7px;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.auth-forgot-link {
  font-size: 0.78rem;
  color: var(--auth-gold-dark);
  text-decoration: none;
  font-weight: 700;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper i {
  position: absolute;
  left: 15px;
  color: var(--auth-text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-field,
.auth-input-wrapper select.auth-field {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--auth-field-bg);
  border: 1.5px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field::placeholder {
  color: #9ca3af;
}

.auth-field:focus {
  border-color: var(--auth-gold-dark);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(249, 212, 35, 0.18);
}

.auth-field:focus ~ i {
  color: var(--auth-gold-dark);
}

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

.auth-field.field-valid {
  border-color: var(--auth-success);
}

select.auth-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.293l3.71-4.06a.75.75 0 111.08 1.04l-4.25 4.65a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px;
}

.auth-toggle-visibility {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--auth-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-toggle-visibility:hover {
  color: var(--auth-navy);
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--auth-text-muted);
  margin-top: 6px;
}

.auth-hint.hint-error {
  color: var(--auth-error);
}

.auth-hint.hint-success {
  color: var(--auth-success);
}

.auth-field-errors {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  color: var(--auth-error);
  font-size: 0.8rem;
}

/* --- SUBMIT BUTTON --- */
.auth-btn-submit {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: var(--auth-gold);
  color: var(--auth-navy);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 10px 25px rgba(249, 212, 35, 0.3);
}

.auth-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(249, 212, 35, 0.4);
}

.auth-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 14, 39, 0.25);
  border-top-color: var(--auth-navy);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}

.auth-btn-submit.is-loading .auth-spinner {
  display: inline-block;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* --- DIVIDER --- */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--auth-text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--auth-border);
}

.auth-divider span {
  padding: 0 12px;
}

/* --- SOCIAL BUTTON --- */
.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #ffffff;
  border: 1.5px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-text);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.auth-social-btn:hover {
  border-color: var(--auth-gold-dark);
  box-shadow: 0 6px 16px rgba(10, 14, 39, 0.08);
  transform: translateY(-1px);
  color: var(--auth-text);
}

/* --- ALERTS --- */
.auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-alert-error {
  background: var(--auth-error-bg);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--auth-error);
}

.auth-alert-success {
  background: var(--auth-success-bg);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: var(--auth-success);
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #b45309;
}

.auth-alert-info {
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}

/* --- FOOTER LINK --- */
.auth-footer-link {
  text-align: center;
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--auth-text-muted);
}

.auth-footer-link a {
  color: var(--auth-gold-dark);
  font-weight: 800;
  text-decoration: none;
}

.auth-footer-link a:hover {
  text-decoration: underline;
}

.auth-bottom-note {
  text-align: center;
  margin-top: 14px;
}

.auth-bottom-note a {
  color: var(--auth-text-muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.auth-bottom-note a:hover {
  color: var(--auth-gold-dark);
}

/* --- TOAST (JS-driven) --- */
.auth-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--auth-navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(10, 14, 39, 0.3);
  z-index: 9999;
}

/* --- RESPONSIVE --- */
@media (max-width: 560px) {
  .auth-card {
    padding: 28px 22px;
    border-radius: 16px;
  }

  .auth-topbar {
    padding: 20px;
  }

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

/* Six-digit verification code (password reset step 2). Wide tracking makes a
   pasted code easy to check at a glance. */
.auth-field-code {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.45em;
  text-indent: 0.45em;   /* re-centres despite the trailing letter-space */
  font-variant-numeric: tabular-nums;
}

.auth-field-code::placeholder {
  letter-spacing: 0.45em;
  font-weight: 500;
}
