/* ==========================================================================
   DEVSTUDIO — CUSTOMER AUTHENTICATION, ACCOUNT & ORDERS STYLESHEET
   Member Login, Registration, Dashboard Portal, Order Tracking & Wishlist
   ========================================================================== */

/* 1. Authentication Pages (Login & Registration) */
.auth-page-container {
  background-color: var(--ds-bg-page);
  padding: clamp(48px, 6vw, 88px) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--ds-header-height) - 120px);
}

.auth-form-wrapper {
  max-width: 480px;
  width: 100%;
}

.auth-card {
  background-color: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: clamp(28px, 4vw, 40px);
  box-shadow: var(--ds-shadow-sm);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-title {
  font-size: clamp(1.625rem, 2.5vw, 2rem);
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-text-primary);
  letter-spacing: -0.02em;
  margin-top: 4px;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--ds-text-secondary);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-forgot-link {
  font-size: 0.75rem;
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-brand-accent);
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-card-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--ds-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--ds-text-secondary);
}

/* 2. Customer Account Portal Dashboard Layout */
.account-page-header {
  background-color: var(--ds-bg-surface-secondary);
  border-bottom: 1px solid var(--ds-border-subtle);
  padding: 32px 0 40px 0;
}

.account-dashboard-layout {
  padding: 48px 0 88px 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: flex-start;
}

/* 3. Account Left Sidebar Navigation */
.account-sidebar {
  background-color: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--ds-header-height) + 24px);
}

.account-user-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ds-border-subtle);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--ds-radius-full);
  background: var(--ds-brand-accent-subtle);
  color: var(--ds-brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: var(--ds-font-weight-bold);
  flex-shrink: 0;
}

.user-name {
  font-size: 0.9375rem;
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--ds-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--ds-radius-sm);
  font-size: 0.875rem;
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-text-secondary);
  transition: background-color var(--ds-transition-fast), color var(--ds-transition-fast);
}

.account-nav-link svg {
  color: var(--ds-text-tertiary);
  transition: color var(--ds-transition-fast);
}

.account-nav-link:hover {
  background-color: var(--ds-bg-surface-secondary);
  color: var(--ds-text-primary);
}

.account-nav-link:hover svg {
  color: var(--ds-brand-accent);
}

.account-nav-link.active {
  background-color: var(--ds-brand-accent-subtle);
  color: var(--ds-brand-accent);
  font-weight: var(--ds-font-weight-semibold);
}

.account-nav-link.active svg {
  color: var(--ds-brand-accent);
}

.account-logout-btn {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ds-border-subtle);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--ds-color-danger);
  padding-left: 14px;
  font-weight: var(--ds-font-weight-medium);
}

.account-logout-btn:hover {
  text-decoration: underline;
}

/* 4. Main Account Content Cards & Metrics */
.account-main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.account-card {
  background-color: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: 28px;
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ds-border-subtle);
}

.account-card-title {
  font-size: 1.25rem;
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-text-primary);
}

/* Metrics Grid */
.account-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--ds-bg-surface-secondary);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.metric-num {
  font-size: 1.75rem;
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-text-primary);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8125rem;
  color: var(--ds-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--ds-font-weight-semibold);
}

/* 5. Orders Table & Cards List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card-row {
  background-color: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  padding: 20px;
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}

.order-card-row:hover {
  border-color: var(--ds-border-default);
  box-shadow: var(--ds-shadow-xs);
}

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ds-border-subtle);
  gap: 12px;
  flex-wrap: wrap;
}

.order-number {
  font-family: var(--ds-font-mono);
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-brand-accent);
  font-size: 0.9375rem;
}

.order-date {
  font-size: 0.8125rem;
  color: var(--ds-text-tertiary);
}

.order-status-pill {
  font-size: 0.6875rem;
  font-weight: var(--ds-font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--ds-radius-full);
}

.status-paid {
  background-color: var(--ds-color-success-bg);
  color: var(--ds-color-success);
  border: 1px solid rgba(14, 131, 69, 0.2);
}

.status-review {
  background-color: var(--ds-color-info-bg);
  color: var(--ds-color-info);
  border: 1px solid rgba(2, 106, 162, 0.2);
}

.status-pending {
  background-color: var(--ds-color-warning-bg);
  color: var(--ds-color-warning);
  border: 1px solid rgba(181, 71, 8, 0.2);
}

.status-rejected {
  background-color: var(--ds-color-danger-bg);
  color: var(--ds-color-danger);
  border: 1px solid rgba(217, 45, 32, 0.2);
}

.order-card-body {
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.order-items-preview {
  font-size: 0.875rem;
  color: var(--ds-text-secondary);
}

.order-total-block {
  text-align: right;
}

.order-total-price {
  font-size: 1.125rem;
  font-weight: var(--ds-font-weight-bold);
  color: var(--ds-text-primary);
}

/* 6. Order Details Timeline & Specific View */
.timeline-track {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 32px 0;
  padding: 0 16px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  height: 2px;
  background-color: var(--ds-border-default);
  z-index: 1;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  text-align: center;
}

.timeline-dot {
  width: 30px;
  height: 30px;
  border-radius: var(--ds-radius-full);
  background-color: var(--ds-bg-surface);
  border: 2px solid var(--ds-border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: var(--ds-font-weight-bold);
  margin-bottom: 8px;
}

.timeline-step.completed .timeline-dot {
  background-color: var(--ds-color-success);
  border-color: var(--ds-color-success);
  color: var(--ds-color-white);
}

.timeline-step.active .timeline-dot {
  background-color: var(--ds-brand-accent);
  border-color: var(--ds-brand-accent);
  color: var(--ds-color-white);
}

.timeline-label {
  font-size: 0.75rem;
  font-weight: var(--ds-font-weight-semibold);
  color: var(--ds-text-secondary);
}

/* 7. Addresses Grid */
.addresses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.address-box {
  background-color: var(--ds-bg-surface-secondary);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.address-badge-default {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: var(--ds-font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-brand-accent);
  background-color: var(--ds-brand-accent-subtle);
  padding: 2px 8px;
  border-radius: var(--ds-radius-xs);
  margin-bottom: 10px;
  width: fit-content;
}

.address-text {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ds-text-secondary);
  margin-bottom: 16px;
}

.address-actions {
  display: flex;
  gap: 12px;
}

/* 8. Wishlist Grid */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* 9. Responsive Breakpoint Adaptations */
@media (max-width: 1024px) {
  .account-dashboard-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .account-sidebar {
    position: static;
  }

  .account-nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .account-nav-link {
    white-space: nowrap;
  }

  .wishlist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .account-metrics-grid {
    grid-template-columns: 1fr;
  }

  .addresses-grid {
    grid-template-columns: 1fr;
  }

  .wishlist-grid {
    grid-template-columns: 1fr;
  }

  .timeline-track {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    padding-left: 20px;
  }

  .timeline-track::before {
    top: 0;
    bottom: 0;
    left: 34px;
    width: 2px;
    height: 100%;
  }

  .timeline-step {
    flex-direction: row;
    gap: 16px;
    text-align: left;
  }
}