/**
 * Customer Authentication & Account Dashboard Styles
 * High-end Noon / Amazon / Stripe aesthetic tailored for Knouz Industrial Supplies
 */

/* Container & Layout */
.auth-page-wrap {
  padding: 3rem 1rem 4rem;
  min-height: calc(100vh - 280px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 35px -5px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, #e07a00 50%, var(--navy) 100%);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease;
}

.auth-brand-logo:hover {
  transform: scale(1.03);
}

.auth-brand-logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Alert Boxes */
.auth-alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.auth-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.auth-alert i {
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Form Controls */
.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.45rem;
}

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

.auth-input-wrap i.auth-input-icon {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input-wrap input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
}

.auth-input-wrap input:focus ~ i.auth-input-icon {
  color: var(--primary);
}

.auth-password-toggle {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

/* Primary Button */
.auth-btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, #e07a00 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(245, 130, 32, 0.28);
  transition: all 0.25s ease;
}

.auth-btn-primary:hover {
  background: linear-gradient(135deg, #e07a00 0%, #c46600 100%);
  box-shadow: 0 6px 18px rgba(245, 130, 32, 0.38);
  transform: translateY(-1px);
}

.auth-btn-primary:active {
  transform: translateY(0);
}

/* Social Separator */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

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

/* Google Sign-In Button */
.auth-google-btn {
  width: 100%;
  height: 48px;
  background: #ffffff;
  color: #374151;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
}

.auth-google-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Google Interactive Modal */
.google-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.google-modal-backdrop.show {
  display: flex;
}

.google-modal-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 2rem 1.75rem;
  position: relative;
  animation: googleModalIn 0.25s ease-out;
}

@keyframes googleModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.google-modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.google-modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.google-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.google-modal-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 1px solid #e2e8f0;
}

.auth-google-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Bottom Links */
.auth-footer-nav {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.auth-footer-nav a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-footer-nav a:hover {
  color: #c46600;
  text-decoration: underline;
}

/* Verification Code Styling */
.verify-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff7ed;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
  border: 2px dashed rgba(245, 130, 32, 0.4);
}

.verify-code-input {
  font-family: 'Courier New', Courier, monospace, var(--font-arabic);
  font-size: 1.8rem !important;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center !important;
  direction: ltr !important;
  padding: 0 16px !important;
}

.dev-helper-pill {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.25rem;
  font-size: 0.85rem;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dev-helper-pill strong {
  color: var(--navy);
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 3px;
  direction: ltr;
}

/* Customer Account Dashboard */
.account-page-wrap {
  padding: 2.5rem 0 4rem;
  background: #f8fafc;
  min-height: calc(100vh - 280px);
}

.account-header-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.75rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.account-profile-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a8a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-name-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-meta-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.account-chip.verified {
  background: #dcfce7;
  color: #15803d;
}

.account-chip.google {
  background: #e0f2fe;
  color: #0369a1;
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.account-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon-wrap.primary {
  background: #fff7ed;
  color: var(--primary);
}

.stat-icon-wrap.navy {
  background: #eff6ff;
  color: #2563eb;
}

.stat-icon-wrap.success {
  background: #f0fdf4;
  color: #16a34a;
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

/* Account Tabs */
.account-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.75rem;
}

.account-tab-btn {
  background: none;
  border: none;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: #64748b;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
}

.account-tab-btn:hover {
  color: var(--navy);
  background: #f1f5f9;
}

.account-tab-btn.active {
  color: var(--primary);
  background: #ffffff;
}

.account-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Orders Table & Cards */
.account-orders-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.orders-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.account-orders-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
}

.account-orders-table th {
  background: #f8fafc;
  padding: 1rem 1.25rem;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
}

.account-orders-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.account-orders-table tr:hover td {
  background: #fafafa;
}

.order-track-link {
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  font-family: monospace;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}

.order-track-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.order-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.order-badge-status.pending { background: #fef3c7; color: #b45309; }
.order-badge-status.processing { background: #e0e7ff; color: #4338ca; }
.order-badge-status.shipped { background: #e0f2fe; color: #0369a1; }
.order-badge-status.completed { background: #dcfce7; color: #15803d; }
.order-badge-status.cancelled { background: #fee2e2; color: #b91c1c; }

/* Empty Orders State */
.empty-orders-wrap {
  text-align: center;
  padding: 4rem 1.5rem;
}

.empty-orders-icon {
  width: 80px;
  height: 80px;
  background: #f1f5f9;
  border-radius: 50%;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem;
}

/* Profile Form Card */
.account-profile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  max-width: 760px;
}

/* User Menu in Header */
.header-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
}

.header-user-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  overflow: hidden;
  flex-shrink: 0;
}

.header-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dropdown Menu */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  min-width: 220px;
  padding: 8px 0;
  z-index: 1000;
  display: none;
  text-align: right;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #334155;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.user-dropdown-item:hover {
  background: #f8fafc;
  color: var(--primary);
}

.user-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

/* Responsive Overrides */
@media (max-width: 640px) {
  .auth-card {
    padding: 2rem 1.25rem;
    border-radius: 12px;
  }

  .account-header-card {
    padding: 1.25rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .account-profile-info {
    width: 100%;
  }

  .account-profile-card {
    padding: 1.5rem 1rem;
  }
}
