/* InstantHPI account page styles.
 *
 * Same design tokens as the live app hub so the account page looks like part of the same site.
 * No external fonts, no external images, no framework, no inline styles. Every layout rule has a
 * narrow-screen form: the page is used at 320, 390, 768 and 1440 CSS pixels.
 */

:root {
  --background-color: #ffffee;
  --primary-color: #117743;
  --primary-hover: #0d5a33;
  --dark-bar: #1a2744;
  --card-color: #fff9e6;
  --border-color: #e0d8c8;
  --text-color: #1a1a2e;
  --muted-color: #4f4f66;
  --gold-color: #f4d77b;
  --focus-ring: #0b5f36;
  --warning-color: #8a4b00;
  --warning-bg: #fff4e0;
  --white: #ffffff;

  --spacing-unit: 4px;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);

  --font-inter: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-georgia: Georgia, "Times New Roman", serif;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-inter);
  font-size: 17px;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--primary-color);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

img,
svg {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.site-header :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible {
  outline-color: var(--gold-color);
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  color: var(--primary-color);
  padding: 8px 12px;
  z-index: 10;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* Header and footer: the same bar the app hub uses. */
.site-header {
  background-color: var(--dark-bar);
  color: var(--white);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}

.brand {
  color: var(--white);
  font-family: var(--font-georgia);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-nav a {
  color: var(--gold-color);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--white);
  text-decoration: underline;
}

.site-footer {
  margin-top: 40px;
  background-color: var(--dark-bar);
  color: var(--white);
  padding: 20px 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--gold-color);
}

.hero {
  background-color: var(--dark-bar);
  color: var(--white);
  padding: 32px 0 28px;
}

.hero h1,
.hero h2 {
  color: var(--white);
}

.hero .lede {
  color: #e7ecf6;
  max-width: 62ch;
}

.hero .eyebrow {
  color: var(--gold-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.hero .lede {
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.hero-actions .btn-outline {
  background: transparent;
  color: var(--gold-color);
  border-color: var(--gold-color);
}

.hero-actions .btn-outline:hover {
  background: var(--gold-color);
  color: var(--dark-bar);
}

.hero-compact {
  padding: 26px 0 22px;
}

/* Footer, matching the app hub. */
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-georgia);
  font-size: 1.15rem;
  font-weight: 700;
}

.footer-line,
.footer-links,
.footer-legal {
  margin: 0;
  font-size: 0.92rem;
}

.footer-legal {
  color: #c3cbdd;
  font-size: 0.85rem;
}

.section-lede + .note-box {
  margin-top: 12px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f2f0e6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.hero a {
  color: var(--gold-color);
}

.section {
  padding: 28px 0 8px;
}

.section + .section {
  border-top: 1px solid var(--border-color);
}

.section-lede {
  max-width: 70ch;
  color: var(--muted-color);
}

.note-box {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin: 0 0 16px;
}

.note-box.warning {
  background: var(--warning-bg);
  border-left-color: var(--warning-color);
  color: #4a2c00;
}

.note-box p:last-child {
  margin-bottom: 0;
}

/* The app library. */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 8px 0 4px;
}

.app-card {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-mark {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.app-mark svg,
.app-mark img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
}

.card-titles {
  min-width: 0;
}

.app-name {
  margin: 0;
  font-size: 1.05rem;
}

.native-title {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.app-summary {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.92rem;
}

.card-actions {
  margin: auto 0 0;
  padding-top: 6px;
}

/* Buttons. */
.btn {
  display: inline-block;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary-color);
  color: var(--white);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--primary-hover);
  color: var(--white);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: #b8c2bd;
  color: #f4f6f5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

.btn-secondary {
  background: var(--dark-bar);
}

.btn-primary {
  background: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary:hover {
  background: #24345c;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  padding: 4px 0;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

/* Forms. */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  max-width: 420px;
}

.field label {
  font-weight: 600;
  font-size: 0.92rem;
}

.field input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-color);
  width: 100%;
}

.field input:focus {
  border-color: var(--primary-color);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--muted-color);
}

.field input[readonly] {
  background: #f2f0e6;
  color: var(--muted-color);
}

/* Sign-in tabs. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 14px;
}

.tab {
  font: inherit;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 8px 14px;
  color: var(--muted-color);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-panel {
  padding-top: 4px;
}

/* Status and errors. */
.status {
  margin: 10px 0 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  color: var(--muted-color);
}

.status.error {
  color: #a01818;
  font-weight: 600;
}

.status.success {
  color: var(--primary-color);
  font-weight: 600;
}

.status.pending {
  color: var(--muted-color);
  font-style: italic;
}

/* Session summary. */
.summary {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  max-width: 640px;
}

.summary dl {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  gap: 6px 14px;
  margin: 0 0 10px;
}

.summary dt {
  font-weight: 600;
  color: var(--muted-color);
}

.summary dd {
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid currentColor;
}

.badge-free {
  color: var(--primary-color);
  background: #eef7f1;
}

.badge-member {
  color: #1f4e79;
  background: #eaf3fb;
}

.badge-practice {
  color: #6b4a00;
  background: #fdf3dd;
}

.badge-signed-out {
  color: var(--muted-color);
  background: #f1f0ea;
}

/* Plans. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 0 4px;
}

.plan-card {
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-card h3 {
  margin-bottom: 0;
}

.plan-price {
  font-family: var(--font-georgia);
  font-size: 1.6rem;
  margin: 0;
}

.plan-price .plan-cadence {
  font-family: var(--font-inter);
  font-size: 0.95rem;
  color: var(--muted-color);
}

.plan-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted-color);
  font-size: 0.94rem;
}

.fine-print {
  color: var(--muted-color);
  font-size: 0.87rem;
  max-width: 76ch;
}

/* Narrow screens. */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .summary dt {
    margin-top: 6px;
  }
}

@media (max-width: 390px) {
  .wrap,
  .header-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tab {
    padding: 8px 10px;
    font-size: 0.95rem;
  }
}
