/*
 * BacWaterOnly — Auth page styles (Sign In, Register, Account)
 * Loaded on [backwater_signin], [backwater_register], [backwater_account].
 */

/* ─── Shared auth form card ─────────────────────────────────────────────── */
.content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}

.bw-auth-wrap {
  max-width: 440px;
  width: 100%;
  margin: auto 0;
  padding: 0;
}

.bw-auth-card {
  background: var(--bw-surface);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-lg);
  overflow: hidden;
}

.bw-auth-header {
  background: var(--bw-ink);
  padding: 28px 32px;
  text-align: center;
}

.bw-auth-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.bw-auth-header p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

.bw-auth-body {
  padding: 32px;
}

/* Tabs (Sign In / Register) */
.bw-auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--bw-border);
  margin: -32px -32px 28px;
}

.bw-auth-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 0;
  background: transparent !important;
  color: var(--bw-ink-muted) !important;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  box-shadow: none;
}

.bw-auth-tab.active {
  color: var(--bw-accent) !important;
  border-bottom-color: var(--bw-accent);
}

/* Fields */
.bw-auth-fields { display: flex; flex-direction: column; gap: 14px; }

.bw-auth-field { display: flex; flex-direction: column; gap: 5px; }

.bw-auth-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bw-ink);
}

.bw-auth-field input {
  padding: 10px 14px;
  border: 1.5px solid var(--bw-border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--bw-ink);
  background: var(--bw-surface);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.bw-auth-field input:focus {
  border-color: var(--bw-accent);
  box-shadow: 0 0 0 3px rgba(26, 79, 216, 0.08);
}

.bw-auth-field input.error {
  border-color: var(--bw-danger);
  background: var(--bw-danger-soft);
}

.bw-auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 400px) {
  .bw-auth-field-row { grid-template-columns: 1fr; }
}

.bw-auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--bw-ink);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}

.bw-auth-submit:hover    { background: #222; }
.bw-auth-submit:disabled { opacity: 0.65; cursor: not-allowed; }

.bw-auth-error {
  background: var(--bw-danger-soft);
  border: 1px solid #fbc8c4;
  color: #7b2a22;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  display: none;
}

.bw-auth-error.visible { display: block; }

.bw-auth-switch {
  text-align: center;
  font-size: 0.8rem;
  color: var(--bw-ink-muted);
  margin-top: 20px;
}

.bw-auth-switch a { color: var(--bw-accent); font-weight: 600; text-decoration: none; }

/* ─── Inline auth modal (popup from home page) ───────────────────────────── */
#bw-auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#bw-auth-modal-overlay.open { display: flex; }

#bw-auth-modal {
  background: var(--bw-surface);
  border-radius: var(--bw-radius-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

#bw-auth-modal .bw-auth-header { border-radius: 0; }

/* ─── Account / dashboard page ───────────────────────────────────────────── */
.bw-dash-wrap {
  max-width: 1100px;
  width: 100%;
  align-self: stretch;
  margin: 0 auto;
  padding: 28px 0 24px;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Stats strip */
.bw-dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.bw-ds-card {
  background: var(--bw-surface);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bw-ds-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--bw-ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-family: 'DM Mono', monospace;
}

.bw-ds-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bw-ink-muted);
}

/* Orders section (flex: 1 so table fills remaining height) */
.bw-dash-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bw-dash-sec-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.bw-dash-sec-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bw-ink-muted);
}

.bw-dash-count {
  background: var(--bw-ink);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

/* Empty state */
.bw-dash-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bw-surface);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
  padding: 40px 24px;
  text-align: center;
  -webkit-border-radius: var(--bw-radius);
  -moz-border-radius: var(--bw-radius);
  -ms-border-radius: var(--bw-radius);
  -o-border-radius: var(--bw-radius);
}

.bw-dash-empty p { color: var(--bw-ink-muted); margin-bottom: 12px; }
.bw-dash-empty a { color: var(--bw-accent); font-weight: 600; text-decoration: none; }

/* Table scroll wrapper */
.bw-table-scroll {
  flex: 1;
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
  background: #fff;
  overflow: hidden;
}

.bw-table-scroll::-webkit-scrollbar { width: 5px; }
.bw-table-scroll::-webkit-scrollbar-track { background: transparent; }
.bw-table-scroll::-webkit-scrollbar-thumb { background: var(--bw-border); border-radius: 3px; }

/* ─── Status pills ────────────────────────────────────────────────────────── */
.bw-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bw-status-paid       { background: #dcfce7; color: #15803d; }
.bw-status-pending    { background: #fef9c3; color: #854d0e; }
.bw-status-processing { background: #dbeafe; color: #1e40af; }
.bw-status-shipped    { background: #e0f2fe; color: #0369a1; }
.bw-status-completed  { background: #bbf7d0; color: #15803d; }
.bw-status-failed     { background: #fee2e2; color: #991b1b; }
.bw-status-cancelled  { background: #f3f4f6; color: #6b7280; }
.bw-status-refunded   { background: #fae8ff; color: #7e22ce; }

/* ─── Account orders table ───────────────────────────────────────────────── */
.bw-orders-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.bw-orders-table thead th {
  background: var(--bw-ink);
  color: rgba(255, 255, 255, 0.7);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: none;
  position: sticky;
  top: 0;
  z-index: 1;
}

.bw-orders-table tbody td {
  padding: 13px 16px;
  border: none;
  border-bottom: 1px solid var(--bw-border);
  vertical-align: middle;
  font-size: 0.85rem;
}

.bw-orders-table tbody tr:last-child td { border-bottom: none; }
.bw-orders-table tbody tr:hover { background: var(--bw-accent-soft); }

.bw-ot-order-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}

.bw-ot-id {
  font-weight: 700;
  font-size: 0.88rem;
}

.bw-acct-view-btn {
  background: var(--bw-ink);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}

.bw-acct-view-btn:hover { background: #333; }

.bw-ot-date { font-size: 0.8rem; color: var(--bw-ink-muted); white-space: nowrap; }

.bw-ot-total {
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}

.bw-ot-product {
  font-size: 0.85rem;
  color: var(--bw-ink);
}

.bw-ot-qty {
  font-size: 0.72rem;
  color: var(--bw-ink-muted);
  margin-left: 4px;
}

/* Pagination */
.bw-pg-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 2px;
  flex-shrink: 0;
}

.bw-pg-btn {
  padding: 5px 14px;
  background: var(--bw-ink);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}

.bw-pg-btn:hover:not(:disabled) { background: #333; }
.bw-pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.bw-pg-info {
  font-size: 0.72rem;
  color: var(--bw-ink-muted);
  min-width: 90px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .bw-orders-table thead th:nth-child(3),
  .bw-orders-table tbody td:nth-child(3) { display: none; }
  .bw-orders-table thead th,
  .bw-orders-table tbody td { padding: 10px 12px; }
  .bw-dash-wrap { padding-left: 16px; padding-right: 16px; }
}

/* ─── Account order detail modal ─────────────────────────────────────────── */
#bw-acct-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.6);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

#bw-acct-modal-overlay.open { display: flex; }

#bw-acct-modal {
  background: var(--bw-surface);
  border-radius: var(--bw-radius-lg);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

#bw-acct-modal-hdr {
  background: var(--bw-ink);
  color: #fff;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#bw-acct-modal-hdr h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

#bw-acct-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

#bw-acct-modal-close:hover { color: #fff; }

#bw-acct-modal-body { padding: 24px 28px; }

.bw-amc-section { margin-bottom: 20px; }
.bw-amc-section:last-child { margin-bottom: 0; }

.bw-amc-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bw-ink-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bw-amc-label::after { content: ''; flex: 1; height: 1px; background: var(--bw-border); }

.bw-amc-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.bw-amc-table th,
.bw-amc-table td { padding: 8px 12px; border: 1px solid var(--bw-border); text-align: left; }
.bw-amc-table th { background: var(--bw-bg); font-weight: 600; color: var(--bw-ink-soft); width: 36%; }

@media (max-width: 480px) {
  #bw-acct-modal-overlay { padding: 16px; }
}
