/* main.css */
:root {
  --primary: #00c7be; /* iOS system mint */
  --bg: #f6f9fc;
  --text: #1a1f36;
  --text-muted: #6b7c93;
  --radius: 8px;
  --shadow: 0 0 0 1px rgba(50, 50, 93, 0.1),
    0 2px 5px 0 rgba(50, 50, 93, 0.1),
    0 1px 1.5px 0 rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

/* Centering for special pages */
body.centered {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding-inline: 16px; /* mobile-safe horizontal gutter */
  background-color: var(--bg);
}

/* Legal pages (Terms, Privacy, Refunds) */
body.legal {
  display: block;
  padding: 40px 16px;
  background-color: var(--bg);
}

body.legal .container {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2.5rem;
  text-align: left;
  line-height: 1.65;
}

body.legal h1 {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  margin-bottom: 1.5rem;
}

body.legal h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

body.legal p,
body.legal li {
  font-size: 0.98rem;
}

.container {
  background-color: #fff;
  padding: 2rem 3rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 480px;
  width: 100%;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
}

.button:hover,
.button-small:hover {
  background-color: #00b0a9;
}

.button-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  background-color: var(--primary);
  border-radius: var(--radius);
  color: #fff;
  border: none;
  cursor: pointer;
  margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 400px) {
  .container {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.3rem;
  }
}

#checkoutResult {
  word-break: break-all;
  white-space: normal;
  font-size: 0.9rem;
  background-color: #f5f5f5;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: #333;
  overflow-wrap: break-word;
  max-width: 100%;
  overflow-x: auto;
  user-select: text;
}

/* QR code sizing adjustments */
.qr {
  max-width: 220px;
  width: 70vw;
  height: auto;
}

/* Admin card layout support */
.page-admin .three-column-layout {
  padding-inline: 16px;
  box-sizing: border-box;
}

.page-admin .panel {
  width: min(100%, 900px);
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .page-admin .three-column-layout {
    padding-inline: 12px;
  }
}

/* ─── Auth handler (email verify / password reset) ─── */
body.page-auth-handler.centered .container {
  max-width: 420px;
  padding: 2rem 1.5rem 3rem;
  --auth-cta-width: min(100%, 250px);
  --store-badge-width: min(100%, 152px);
}

body.page-auth-handler #open-app,
body.page-auth-handler .auth-handler-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--auth-cta-width);
  margin-inline: auto;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  text-align: center;
  box-sizing: border-box;
}

body.page-auth-handler #resend-btn {
  width: var(--auth-cta-width);
  margin-inline: auto;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  box-sizing: border-box;
}

body.page-auth-handler .input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(26, 31, 54, 0.12);
  box-sizing: border-box;
  color: var(--text);
}

body.page-auth-handler .auth-handler-store-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

body.page-auth-handler .auth-handler-store-links .store-badge-link {
  display: block;
  width: var(--store-badge-width);
  margin-inline: auto;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
  text-decoration: none;
}

body.page-auth-handler .auth-handler-store-links .store-badge-img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

@media (min-width: 768px) {
  body.page-auth-handler .auth-handler-store-links {
    gap: 14px;
  }
}
