/* AF PWA — isolated from styles.css, no shared dependencies */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #2D5016;
  --green-light: #F0F7E8;
  --green-mid:   #4A7030;
  --green-dark:  #1A3A0A;
  --peach:       #FFD6B2;
  --cream:       #FFF7EF;
  --text:        #1A1A1A;
  --muted:       #6B7280;
  --border:      #E5E7EB;
  --r:           12px;
  --r-sm:        8px;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────── */

.af-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 44px;
  max-width: 440px;
  margin: 0 auto;
}

.af-spacer { flex: 1; }

/* ── Brand ───────────────────────────────────── */

.af-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 36px;
}

.af-brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Mini logo for pages with back-button header */
.af-brand-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Row that holds back-button + mini logo */
.af-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.af-page-header .af-back {
  margin-bottom: 0;
}

.af-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── Typography ──────────────────────────────── */

.af-h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
}

.af-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 28px;
}

/* ── Form ────────────────────────────────────── */

.af-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.af-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.af-input {
  height: 50px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 0 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

.af-input:focus { border-color: var(--green); }

.af-input[readonly] {
  background: var(--green-light);
  color: var(--green-dark);
  cursor: default;
}

/* Phone input with +91 prefix */
.af-input-wrap {
  display: flex;
  align-items: center;
  height: 50px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 0 14px;
  gap: 10px;
  transition: border-color .15s;
}

.af-input-wrap:focus-within { border-color: var(--green); }

.af-prefix {
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
  border-right: 1.5px solid var(--border);
  padding-right: 10px;
  line-height: 1;
  user-select: none;
}

.af-input-inner {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  height: 100%;
  min-width: 0;
}

/* ── Buttons ─────────────────────────────────── */

.af-btn {
  width: 100%;
  height: 52px;
  border-radius: var(--r-sm);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s, transform .08s;
  margin-top: 4px;
}

.af-btn:active  { transform: scale(.98); }
.af-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.af-btn-primary   { background: var(--green); color: #fff; }
.af-btn-secondary { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.af-btn-ghost     { background: var(--green-light); color: var(--green); }

/* ── OTP boxes ───────────────────────────────── */

.af-otp-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.af-otp-box {
  width: 46px;
  height: 56px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--green-dark);
  outline: none;
  transition: border-color .15s, background .15s;
  caret-color: var(--green);
}

.af-otp-box:focus { border-color: var(--green); }

.af-otp-box.filled {
  border-color: var(--green);
  background: var(--green-light);
}

/* ── Alerts ──────────────────────────────────── */

.af-error {
  background: #FEE2E2;
  color: #991B1B;
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
  display: none;
}

.af-error.visible { display: block; }

.af-info {
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
}

/* ── Resend timer ────────────────────────────── */

.af-resend {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.af-resend-link {
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  padding: 0;
  display: none;
}

.af-resend-link.visible { display: inline; }

/* ── Spinner ─────────────────────────────────── */

.af-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: af-spin .55s linear infinite;
  display: none;
  flex-shrink: 0;
}

.af-spinner.visible { display: block; }

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

/* ── Back row ────────────────────────────────── */

.af-back {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  cursor: pointer;
  width: fit-content;
  color: var(--muted);
  font-size: 14px;
}

/* ── Card ────────────────────────────────────── */

.af-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.af-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.af-card-label { font-size: 13px; color: var(--muted); }

.af-card-value { font-size: 14px; font-weight: 500; color: var(--text); }

/* ── Credit bar ──────────────────────────────── */

.af-credit-bar {
  background: var(--green-light);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.af-credit-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  margin-top: 4px;
}

.af-credit-label {
  font-size: 12px;
  color: var(--green-mid);
  margin-bottom: 2px;
}

/* ── Dashboard ───────────────────────────────── */

.af-greeting {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.af-greeting-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.af-placeholder {
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ── Small text & links ──────────────────────── */

.af-link-text {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}

.af-link {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.af-link:hover { text-decoration: underline; }

.af-legal {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  margin-top: 14px;
}

/* ── Section title ───────────────────────────── */

.af-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 20px 0 10px;
}

/* ── Select dropdown ─────────────────────────── */

.af-select {
  height: 50px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 0 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color .15s;
}

.af-select:focus { border-color: var(--green); }

/* ── Zone confirm badge ──────────────────────── */

.af-zone-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-light);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--green-dark);
  margin-top: -6px;
  margin-bottom: 4px;
}

/* ── Mini calendar ───────────────────────────── */

.af-cal-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
}

.af-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--green-light);
  padding: 10px 14px;
}

.af-cal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
}

.af-cal-nav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--green);
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: background .1s;
}

.af-cal-nav:hover { background: rgba(45,80,22,.1); }
.af-cal-nav:disabled { opacity: .3; cursor: not-allowed; }

.af-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 10px 8px 12px;
}

.af-cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 4px;
}

.af-cal-num {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}

.af-cal-num:hover:not(.af-cal-past):not(.af-cal-gray) {
  background: var(--green-light);
}

.af-cal-past  { color: var(--border); cursor: default; }
.af-cal-gray  { color: var(--border); cursor: default; }

.af-cal-today {
  font-weight: 700;
  color: var(--green);
}

.af-cal-selected {
  background: var(--green) !important;
  color: #fff !important;
  font-weight: 700;
}

/* ── Time slots ──────────────────────────────── */

.af-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.af-time-slot {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 4px;
  text-align: center;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  background: #fff;
  white-space: nowrap;
}

.af-time-slot:hover:not(.af-time-unavail) {
  border-color: var(--green);
  background: var(--green-light);
}

.af-time-selected {
  border-color: var(--green) !important;
  background: var(--green-light) !important;
  color: var(--green-dark) !important;
  font-weight: 600;
}

.af-time-unavail {
  opacity: .35;
  cursor: not-allowed;
  background: var(--cream);
}

/* ── Calendly wrapper ────────────────────────── */

.af-calendly-wrap {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Success icon ────────────────────────────── */

.af-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #D1FAE5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  align-self: center;
  margin: 0 auto 16px;
}

/* ── Button row (side-by-side) ───────────────── */

.af-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

/* ── Booking meta row ────────────────────────── */

.af-booking-meta {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.af-booking-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.af-booking-meta-label { font-size: 13px; color: var(--muted); }
.af-booking-meta-value { font-size: 13px; font-weight: 500; color: var(--text); text-align: right; }

/* ── Divider rule ────────────────────────────── */

.af-rule {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
