/* SwiftlyOrder — auth.css
   Login, register, forgot-password, reset-password pages.
   Uses auth.php layout (no nav, no footer).
   Icons: self-hosted FA 6.6. */

/* ── Auth page shell ─────────────────────────────────────── */
.auth-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-6);
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
}

/* ── Centered wrapper ────────────────────────────────────── */
.auth-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
}

/* ── Brand logo at the top ───────────────────────────────── */
.auth-brand {
  display: flex; align-items: center; gap: var(--sp-3);
  text-decoration: none;
}
.auth-brand img {
  height: 40px; width: auto; border-radius: var(--r-md);
}
.auth-brand span {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--text-xl); color: var(--white);
  letter-spacing: -0.02em;
}

/* ── The card ────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-lg);
}

.auth-card-header {
  margin-bottom: var(--sp-6);
  text-align: center;
}
.auth-card-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.auth-card-header p {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: var(--sp-2);
}

/* ── Form ────────────────────────────────────────────────── */
.auth-form {
  display: flex; flex-direction: column; gap: var(--sp-5);
}

/* Name row — first + last side by side */
.auth-name-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4);
}

/* ── Password field (input + eye toggle) ─────────────────── */
.auth-password-wrap { position: relative; }
.auth-password-wrap .form-input { padding-right: 3rem; }
.auth-password-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--gray-400); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-2); transition: color var(--dur-fast); font-size: 15px;
}
.auth-password-toggle:hover { color: var(--blue-600); }

/* ── Label + forgot password row ─────────────────────────── */
.auth-password-label-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.auth-password-label-row .form-label { margin-bottom: 0; }
.auth-forgot {
  font-size: var(--text-xs); font-weight: 600; color: var(--blue-600);
}
.auth-forgot:hover { color: var(--blue-700); }

/* ── Options row (remember me) ───────────────────────────── */
.auth-options {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-sm);
}
.auth-remember {
  display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; color: var(--gray-600); font-size: var(--text-sm);
}
.auth-remember input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--blue-600); cursor: pointer;
}

.auth-terms-row {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  cursor: pointer;
}
.auth-terms-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--blue-600); cursor: pointer;
}
.auth-terms-row input[type="checkbox"].is-invalid { outline: 1.5px solid var(--danger); outline-offset: 2px; }

/* ── Submit button ───────────────────────────────────────── */
.auth-submit {
  width: 100%; padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 700;
  background: var(--blue-600); color: var(--white);
  border: none; border-radius: var(--r-md); cursor: pointer;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform 80ms;
  box-shadow: var(--shadow-blue);
}
.auth-submit:hover { background: var(--blue-700); }
.auth-submit:active { transform: scale(0.99); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Switch page link ────────────────────────────────────── */
.auth-switch {
  text-align: center; font-size: var(--text-sm); color: var(--gray-500);
}
.auth-switch a { color: var(--blue-600); font-weight: 600; }
.auth-switch a:hover { color: var(--blue-700); }

/* ── Footer note below card ──────────────────────────────── */
.auth-footer-note {
  font-size: var(--text-xs); color: rgba(255,255,255,0.35); text-align: center;
}

/* ── Role selector (register page) ──────────────────────── */
.auth-role-select {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3);
}
.auth-role-btn {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3); background: var(--gray-50);
  border: 2px solid var(--gray-200); border-radius: var(--r-lg);
  color: var(--gray-600); font-size: var(--text-sm); font-weight: 600;
  font-family: var(--font-display); cursor: pointer; text-align: center;
  line-height: 1.3;
  transition: border-color var(--dur-fast), color var(--dur-fast),
              background var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-role-btn i { font-size: 22px; margin-bottom: 2px; }
.auth-role-btn:hover { border-color: var(--blue-600); color: var(--gray-900); }
.auth-role-btn--active {
  border-color: var(--blue-600); background: var(--blue-50);
  color: var(--blue-600); box-shadow: 0 0 0 3px rgba(26,79,214,0.12);
}
.auth-role-sublabel {
  font-size: var(--text-xs); font-weight: 400; color: var(--gray-400); display: block;
}
.auth-role-btn--active .auth-role-sublabel { color: var(--blue-600); opacity: 0.75; }

/* Upload zone (create business cover) */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  text-align: center;
}
.upload-zone:hover { border-color: var(--blue-600); background: var(--blue-50); }
.upload-icon {
  width: 48px; height: 48px; background: var(--gray-100); border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--gray-400);
}
.upload-label { font-size: var(--text-sm); font-weight: 600; color: var(--gray-700); }
.upload-hint  { font-size: var(--text-xs); color: var(--gray-400); }

/* ── Password strength bar ───────────────────────────────── */
.password-strength {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-2); min-height: 20px;
}
.password-strength-bar {
  flex: 1; height: 4px; background: var(--gray-200);
  border-radius: 2px; overflow: hidden;
}
.password-strength-fill {
  height: 100%; width: 0%;
  border-radius: 2px; transition: width 0.3s var(--ease), background 0.3s var(--ease);
}
.password-strength-label {
  font-size: var(--text-xs); font-weight: 600; min-width: 60px; text-align: right;
}
.strength-weak   { background: var(--danger); }
.strength-fair   { background: var(--amber-500); }
.strength-good   { background: var(--info); }
.strength-strong { background: var(--success); }

/* ── Terms row ───────────────────────────────────────────── */
.auth-terms { font-size: var(--text-sm); color: var(--gray-600); }
.auth-terms a { color: var(--blue-600); font-weight: 600; }

/* ── Error shake animation ───────────────────────────────── */
.alert-error { animation: shake 0.4s var(--ease) both; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(3px); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: var(--sp-6) var(--sp-5); border-radius: var(--r-lg); }
  .auth-card-header h1 { font-size: var(--text-xl); }
  .auth-name-row { grid-template-columns: 1fr; }
  .auth-options { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .auth-role-select { grid-template-columns: 1fr; }
}
