/* ============================================================
   vnty-dashboard — Shared Styles
   Apple-inspired dark design
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #000000;
  --surface:      #1c1c1e;
  --surface-2:    #2c2c2e;
  --border:       rgba(255,255,255,0.1);
  --text:         #ffffff;
  --text-2:       rgba(255,255,255,0.55);
  --text-3:       rgba(255,255,255,0.3);
  --accent:       #0a84ff;
  --green:        #30d158;
  --amber:        #ff9f0a;
  --red:          #ff453a;
  --radius-sm:    10px;
  --radius:       16px;
  --radius-lg:    22px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  letter-spacing: -0.2px;
}
.btn-primary:hover  { opacity: .85; }
.btn-primary:active { opacity: .7; }
.btn-primary:disabled { opacity: .4; cursor: default; }

.btn-secondary {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 0;
}
.btn-secondary:hover { opacity: .75; }

/* ── Inputs ── */
input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 17px;
  outline: none;
  transition: border-color .2s;
}
input[type="email"]::placeholder,
input[type="text"]::placeholder { color: var(--text-3); }
input[type="email"]:focus,
input[type="text"]:focus { border-color: var(--accent); }


/* ============================================================
   AUTH — Login page
   ============================================================ */

.auth-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 40px;
  opacity: .9;
}

.auth-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 32px;
  line-height: 1.6;
}

.auth-step {
  display: none;
  animation: fadeIn .25s ease;
}
.auth-step.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.input-group { margin-bottom: 16px; }

/* OTP digits */
.otp-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.otp-digit {
  flex: 1;
  aspect-ratio: 1;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, transform .1s;
}
.otp-digit:focus   { border-color: var(--accent); transform: scale(1.04); }
.otp-digit.error   { border-color: var(--red); animation: shake .3s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

.auth-resend {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.auth-resend button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}

.auth-error {
  color: var(--red);
  font-size: 14px;
  margin-top: 12px;
  animation: fadeIn .2s ease;
}

/* Loading spinner */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto 20px;
}
.loading-text {
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
}

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


/* ============================================================
   DASHBOARD
   ============================================================ */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}

.dash-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-user-email {
  font-size: 13px;
  color: var(--text-2);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-logout {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.dash-logout:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }

/* Main content */
.dash-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.dash-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
  margin-top: 40px;
}
.dash-section-title:first-child { margin-top: 0; }

/* Order card */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.order-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.order-card-header {
  padding: 20px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.order-number {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.order-date {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.status-badge.active   { background: rgba(48,209,88,0.15);  color: var(--green); }
.status-badge.abgeholt { background: rgba(10,132,255,0.15); color: var(--accent); }
.status-badge.returned { background: var(--surface-2); color: var(--text-2); }

/* Status stepper */
.order-stepper {
  padding: 0 20px 20px;
  display: flex;
  align-items: center;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all .3s;
}
.step-dot.done {
  background: var(--green);
  border-color: var(--green);
}
.step-dot.done::after {
  content: '✓';
  color: #000;
  font-weight: 700;
  font-size: 12px;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: -18px;
}
.step-line.done { background: var(--green); }

.step-label {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
}
.step-label.done { color: var(--green); }

/* Detail view */
.order-detail {
  display: none;
  animation: fadeIn .3s ease;
}
.order-detail.open { display: block; }

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 17px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 28px;
}
.back-btn:hover { opacity: .75; }

/* Info rows */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 15px; color: var(--text-2); }
.info-value { font-size: 15px; font-weight: 500; text-align: right; max-width: 60%; }

/* QR Code */
.qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.qr-label {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
}
.qr-code {
  border-radius: var(--radius-sm);
  display: block;
}

/* Products */
.product-list { display: flex; flex-direction: column; gap: 1px; }
.product-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.product-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.product-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.product-item:only-child { border-radius: var(--radius); border-bottom: none; }

.product-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.product-img-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.product-info { flex: 1; min-width: 0; }
.product-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-qty { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* Archive item */
.archive-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .2s;
}
.archive-item:hover { border-color: rgba(255,255,255,0.2); }
.archive-order-no { font-size: 17px; font-weight: 600; }
.archive-date { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.archive-chevron { color: var(--text-3); font-size: 18px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.empty-text { font-size: 15px; color: var(--text-2); line-height: 1.6; }

/* Full-page loading */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
}
.page-loading p { color: var(--text-2); font-size: 15px; }
