/* ============================================================
   QayGo — Authentication Styles (Jumia-inspired)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary-orange: #ff6b35;
  --primary-orange-dark: #e55a2b;
  --primary-orange-light: #ff8a65;
  --secondary-orange: #ff8c42;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Container ───────────────────────────────────────────────── */
.auth-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Card ────────────────────────────────────────────────────── */
.auth-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-orange),
    var(--secondary-orange)
  );
}

/* ── Logo Section ────────────────────────────────────────────── */
.logo-section {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 3px solid var(--primary-orange);
  padding: 2px;
}

.brand-name {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.025em;
}

/* ── Welcome Section ─────────────────────────────────────────── */
.welcome-section {
  text-align: center;
  margin-bottom: 2rem;
}

.welcome-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--gray-600);
  font-weight: 400;
}

/* ── Account Type Selector ───────────────────────────────────── */
.account-type-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--gray-100);
  border-radius: var(--border-radius);
  padding: 0.25rem;
}

.account-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  background: transparent;
  border: none;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.account-type-btn:hover {
  background: white;
  color: var(--gray-900);
}

.account-type-btn.active {
  background: white;
  color: var(--primary-orange);
  box-shadow: var(--shadow-sm);
}

.account-type-btn i {
  font-size: 1rem;
}

/* ── Social Login ────────────────────────────────────────────── */
.social-login {
  margin-bottom: 2rem;
}

.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  background: white;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.social-btn:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.google-btn {
  border-color: #dadce0;
  color: #3c4043;
}

.google-btn:hover {
  border-color: #c4c7c5;
  background: #f8f9fa;
}

.social-btn i {
  font-size: 1.125rem;
}

.divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gray-300);
}

.divider span {
  background: white;
  padding: 0 1rem;
  color: var(--gray-500);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ── Form Styles ─────────────────────────────────────────────── */
.auth-form {
  margin-bottom: 2rem;
}

.form-fields {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 400;
  background: white;
  color: var(--gray-900);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.password-input-container {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

/* ── Password Strength Indicator ─────────────────────────────── */
.password-strength {
  margin-top: 0.5rem;
}

.strength-meter {
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-bar.weak {
  background: var(--error);
  width: 33%;
}

.strength-bar.medium {
  background: var(--warning);
  width: 66%;
}

.strength-bar.strong {
  background: var(--success);
  width: 100%;
}

.strength-text {
  font-size: 0.75rem;
  font-weight: 500;
}

.strength-text.weak {
  color: var(--error);
}

.strength-text.medium {
  color: var(--warning);
}

.strength-text.strong {
  color: var(--success);
}

/* ── Field Errors ───────────────────────────────────────────── */
.field-error {
  color: var(--error);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: block;
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── Form Options ────────────────────────────────────────────── */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}

.checkbox-container input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  position: relative;
  transition: var(--transition);
}

.checkbox-container input:checked + .checkmark {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
}

.checkbox-container input:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.forgot-link {
  color: var(--primary-orange);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.forgot-link:hover {
  color: var(--primary-orange-dark);
  text-decoration: underline;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: var(--primary-orange);
  color: white;
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-orange-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-loader i {
  font-size: 1rem;
}

/* ── Auth Footer ─────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.auth-footer p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

.auth-link {
  color: var(--primary-orange);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.auth-link:hover {
  color: var(--primary-orange-dark);
  text-decoration: underline;
}

/* ── Status Messages ─────────────────────────────────────────── */
.status-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.status-message.error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

.status-message.success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.2s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  text-align: center;
}

.role-selection {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  background: white;
  cursor: pointer;
  transition: var(--transition);
}

.role-option:hover {
  border-color: var(--primary-orange);
  background: var(--gray-50);
}

.role-option i {
  font-size: 1.5rem;
  color: var(--primary-orange);
}

.role-option div {
  flex: 1;
}

.role-option h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.25rem 0;
}

.role-option p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Responsive Design ────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }

  .logo {
    width: 50px;
    height: 50px;
  }

  .brand-name {
    font-size: 1.75rem;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .account-type-selector {
    flex-direction: column;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ── Dark Mode Support ────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;
  }

  .auth-card {
    background: var(--gray-800);
    color: var(--gray-100);
  }

  .form-input {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-100);
  }

  .form-input:focus {
    border-color: var(--primary-orange);
  }

  .social-btn {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-200);
  }

  .social-btn:hover {
    background: var(--gray-600);
  }
}
