/* ============================================================
   Auth modal + account widget
   Uses the same CSS variables as style.css so it inherits the
   dark / indigo / Inter theme automatically.
   ============================================================ */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: auth-fade-in 0.18s ease-out;
}

@keyframes auth-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary, #18181b);
  border: 1px solid var(--border, #27272a);
  border-radius: var(--radius-lg, 16px);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.5));
  animation: auth-modal-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes auth-modal-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted, #52525b);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}

.auth-modal-close:hover {
  color: var(--text-primary, #fafafa);
  background: rgba(255, 255, 255, 0.06);
}

.auth-modal-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary, #fafafa);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.auth-modal-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent, #6366f1), var(--accent-hover, #818cf8));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.auth-modal-logo-icon svg {
  width: 15px;
  height: 15px;
}

.auth-modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary, #fafafa);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.auth-modal-sub {
  font-size: 13.5px;
  color: var(--text-secondary, #a1a1aa);
  line-height: 1.5;
  margin: 0 0 18px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-input, #1e1e21);
  border: 1px solid var(--border, #27272a);
  border-radius: 10px;
}

.auth-tab {
  flex: 1 1 0;
  background: transparent;
  border: none;
  color: var(--text-secondary, #a1a1aa);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab:hover {
  color: var(--text-primary, #fafafa);
}

.auth-tab.active {
  background: var(--bg-card, #1c1c1f);
  color: var(--text-primary, #fafafa);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #a1a1aa);
  letter-spacing: 0.02em;
}

.auth-field input {
  width: 100%;
  background: var(--bg-input, #1e1e21);
  border: 1px solid var(--border, #27272a);
  color: var(--text-primary, #fafafa);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input::placeholder {
  color: var(--text-muted, #52525b);
}

.auth-field input:focus {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(99, 102, 241, 0.15));
}

.auth-error {
  background: var(--red-dim, rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  line-height: 1.4;
}

.auth-submit {
  margin-top: 4px;
  width: 100%;
  background: var(--accent, #6366f1);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent-hover, #818cf8);
}

.auth-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-footnote {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-muted, #52525b);
  text-align: center;
  line-height: 1.5;
}

/* === Navbar account widget === */

#account-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.account-signin {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, #27272a);
  color: var(--text-primary, #fafafa);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.account-signin:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light, #3f3f46);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, #27272a);
  color: var(--text-primary, #fafafa);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 220px;
}

.account-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light, #3f3f46);
}

.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #6366f1), var(--accent-hover, #818cf8));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.account-email {
  font-size: 12.5px;
  color: var(--text-secondary, #cbd5e1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--bg-secondary, #18181b);
  border: 1px solid var(--border, #27272a);
  border-radius: 10px;
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.5));
  padding: 6px;
  z-index: 200;
  animation: auth-modal-in 0.15s ease-out;
}

.account-menu-email {
  padding: 8px 10px 10px;
  color: var(--text-secondary, #a1a1aa);
  font-size: 12px;
  border-bottom: 1px solid var(--border, #27272a);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary, #fafafa);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s;
}

.account-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* === Checkout auth gate (cart-driven page) === */

.auth-gate {
  max-width: 520px;
  margin: 80px auto 40px;
  padding: 40px 32px;
  background: var(--bg-secondary, #18181b);
  border: 1px solid var(--border, #27272a);
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.25));
}

.auth-gate-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(99, 102, 241, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #6366f1);
}

.auth-gate h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #fafafa);
  margin: 0 0 10px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.auth-gate p {
  color: var(--text-secondary, #a1a1aa);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* === Mobile === */

@media (max-width: 480px) {
  .auth-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .auth-modal {
    max-width: 100%;
    padding: 24px 20px 22px;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: auth-modal-in-mobile 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  }
  @keyframes auth-modal-in-mobile {
    from { transform: translateY(48px); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
  .auth-modal h2 { font-size: 18px; }
  .auth-modal-sub { font-size: 13px; }
  /* font-size:16px on inputs prevents iOS Safari's auto-zoom on focus */
  .auth-field input { font-size: 16px; padding: 12px 14px; }
  .auth-submit { font-size: 15px; padding: 13px 18px; }
  .account-email { display: none; }
  .account-chip { padding: 4px; }
  .auth-gate { margin: 40px 16px; padding: 28px 22px; }
  .auth-gate h1 { font-size: 18px; }
  .auth-gate p { font-size: 13.5px; }
}

/* === Support disclaimer ===
   Shown above the Whop iframe when fulfilment can't be auto-itemized:
   recurring billing (every cycle is hand-curated) or SkinsBack pricing is
   down (we can't price one-time orders against the live market). The
   accompanying .iframe-lock dims and blocks the iframe until ack. */
.support-disclaimer {
  position: relative;
  margin: 0 0 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  color: var(--text-primary, #f4f4f5);
  font-size: 14px;
  line-height: 1.55;
}
.support-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fbbf24;
}
.support-disclaimer-title svg { flex-shrink: 0; }
.support-disclaimer-body {
  color: var(--text-secondary, #a1a1aa);
  margin: 0 0 14px;
}
.support-disclaimer-body strong { color: var(--text-primary, #e5e7eb); font-weight: 600; }
.support-disclaimer-body a {
  color: #fbbf24;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.support-disclaimer-ack {
  appearance: none;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.support-disclaimer-ack:hover {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.65);
}

/* pointer-events:none on the wrapper also kills clicks against the iframe
   contents, so the user can't sneak past the disclaimer. */
.iframe-lock {
  pointer-events: none;
  filter: blur(2px) saturate(0.8);
  opacity: 0.55;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

/* === Support-required gate ===
   Non-recoverable UI replacement for cart totals over MAX_SELF_SERVE_AMOUNT.
   Replaces the whole checkout (same pattern as .auth-gate) and routes the
   customer to Telegram support for manual vetting. */
.support-gate {
  max-width: 480px;
  margin: 64px auto 40px;
  padding: 36px 28px;
  background: var(--surface, #0a0a0a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-align: center;
}
.support-gate-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
}
.support-gate h1 {
  margin: 0 0 10px;
  color: var(--text-primary, #f4f4f5);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.support-gate p {
  color: var(--text-secondary, #a1a1aa);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 22px;
}
.support-gate-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: #229ED9;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.support-gate-cta:hover { background: #1e90c9; }
.support-gate-cta svg { flex-shrink: 0; }

@media (max-width: 480px) {
  .support-gate { margin: 32px 16px; padding: 28px 22px; }
  .support-gate h1 { font-size: 18px; }
  .support-gate p { font-size: 13.5px; }
  .support-disclaimer { padding: 14px 16px; }
}

/* === Post-payment delivery form (non-admin invoices) === */
.delivery-page {
  max-width: 560px;
  margin: 56px auto 40px;
  padding: 0 16px;
}
.delivery-header {
  text-align: center;
  margin: 0 0 28px;
}
.delivery-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
}
.delivery-success-icon-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}
.delivery-header h1 {
  margin: 0 0 8px;
  color: var(--text-primary, #f4f4f5);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.delivery-header p {
  margin: 0;
  color: var(--text-secondary, #a1a1aa);
  font-size: 14px;
  line-height: 1.55;
}
.delivery-header p strong {
  color: var(--text-primary, #e5e7eb);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}
.delivery-header a {
  color: #fbbf24;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.delivery-form {
  background: var(--surface, #0a0a0a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.delivery-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.delivery-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e5e7eb);
  display: flex;
  align-items: center;
  gap: 6px;
}
.delivery-label em {
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fbbf24;
}
.delivery-field input {
  appearance: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-primary, #f4f4f5);
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.delivery-field input:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(255, 255, 255, 0.05);
}
.delivery-field small {
  color: var(--text-secondary, #71717a);
  font-size: 12px;
  line-height: 1.45;
}
.delivery-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.45;
}
.delivery-submit {
  appearance: none;
  border: none;
  background: #22c55e;
  color: #052e16;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.delivery-submit:hover:not(:disabled) { background: #16a34a; }
.delivery-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.delivery-section {
  margin: 22px 0 0;
  padding: 16px 18px;
  background: var(--surface, #0a0a0a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.delivery-section h3 {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #e5e7eb);
  letter-spacing: 0.01em;
}
.delivery-section-issue {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02));
}
.delivery-section-issue h3 { color: #fbbf24; }
.delivery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.delivery-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary, #a1a1aa);
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.delivery-list li:last-child { border-bottom: none; }
.delivery-list-name {
  color: var(--text-primary, #e5e7eb);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delivery-meta {
  font-size: 12px;
  color: var(--text-secondary, #71717a);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .delivery-page { margin: 32px auto 24px; padding: 0 12px; }
  .delivery-header h1 { font-size: 19px; }
  .delivery-form { padding: 18px 16px; }
  .delivery-field input { font-size: 16px; padding: 11px 12px; }
  .delivery-submit { font-size: 15px; padding: 13px 18px; }
}
