/* =============================================================================
   Upload Prescription Page — /upload-prescription/
   Template: page-upload-prescription.php
   All selectors scoped to #up-page or .up-* prefix.
   ============================================================================= */

/* ── Page wrapper ────────────────────────────────────────────────────── */
#up-page { display: block; }

.up-wrap {
  background: var(--om-bg);
  padding: 40px 0 60px;
}

.up-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 50px;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────── */
.up-crumb {
  background: var(--om-navy);
  padding: 22px 50px;
}

.up-crumb__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
}

.up-crumb__inner a { color: rgba(255,255,255,.8); text-decoration: none; }
.up-crumb__inner a:hover { color: #fff; }
.up-crumb__inner .bi { font-size: 11px; }
.up-crumb__here { color: #fff; font-weight: 600; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.up-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 24px 0 36px;
}

.up-eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--om-blue);
  margin-bottom: 12px;
}

.up-hero__text h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.015em;
  color: var(--om-navy);
  margin-bottom: 16px;
}

.up-hero__text p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--om-ink-2);
  max-width: 520px;
}

.up-hero__img {
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  border: 1px solid var(--om-line);
  background: linear-gradient(135deg, #eef3fb 0%, #dde7f4 50%, #cfdcef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8fa3c0;
}

/* ── Card (form + confirmation share this shell) ─────────────────────── */
.up-card {
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(3,13,78,.06);
}

/* ── Segmented control ───────────────────────────────────────────────── */
.up-seg {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.up-seg__inner {
  display: inline-flex;
  gap: 4px;
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 50px;
  padding: 5px;
}

.up-seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  border: none;
  background: transparent;
  font-family: var(--om-font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--om-ink-3);
  cursor: pointer;
  transition: background 200ms ease-out, color 200ms ease-out;
  white-space: nowrap;
}

.up-seg__btn:hover:not(.up-seg__btn--active) { color: var(--om-navy); }

.up-seg__btn--active {
  background: var(--om-navy);
  color: #fff;
}

/* ── Form grid ───────────────────────────────────────────────────────── */
.up-form-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
}

.up-col__eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--om-blue);
  margin-bottom: 6px;
}

.up-col__hint {
  font-size: 13px;
  color: var(--om-ink-3);
  margin-bottom: 20px;
  line-height: 1.5;
}

.up-col--hidden { display: none; }

/* ── Form fields ─────────────────────────────────────────────────────── */
.up-field { margin-bottom: 16px; }

.up-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--om-ink-2);
  margin-bottom: 6px;
}

.up-req { color: var(--om-danger); margin-left: 2px; }

.up-field input[type="text"],
.up-field input[type="email"],
.up-field input[type="tel"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--om-line);
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--om-font-sans);
  color: var(--om-ink-2);
  padding: 0 16px;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
  outline: none;
}

.up-field input[type="text"]:focus,
.up-field input[type="email"]:focus { border-color: var(--om-blue); box-shadow: 0 0 0 3px rgba(3,105,161,.15); }

.up-field input.is-valid  { border-color: var(--om-success); }
.up-field input.is-invalid { border-color: var(--om-danger); }

.up-field__hint { font-size: 12px; color: var(--om-ink-3); margin-top: 5px; }

.up-field__err {
  display: none;
  font-size: 12px;
  color: var(--om-danger);
  margin-top: 5px;
  align-items: center;
  gap: 4px;
}
.up-field__err.is-visible { display: flex; }

/* ── Phone composite ─────────────────────────────────────────────────── */
.up-phone-row {
  display: flex;
  position: relative;
  border: 1px solid var(--om-line);
  border-radius: 12px;
  overflow: visible;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}

.up-phone-row:focus-within { border-color: var(--om-blue); box-shadow: 0 0 0 3px rgba(3,105,161,.15); }
.up-phone-row.is-valid  { border-color: var(--om-success); }
.up-phone-row.is-invalid { border-color: var(--om-danger); }

.up-cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 102px;
  padding: 0 12px;
  height: 48px;
  flex-shrink: 0;
  background: #fafbff;
  border: none;
  border-right: 1px solid var(--om-line);
  border-radius: 12px 0 0 12px;
  font-size: 14px;
  color: var(--om-ink-2);
  cursor: pointer;
  transition: background 200ms ease-out;
}

.up-cc-btn:hover { background: var(--om-surface-2); }
.up-cc-flag { font-size: 18px; line-height: 1; }
.up-cc-dial { font-size: 14px; font-weight: 500; }
.up-cc-btn .bi { font-size: 12px; color: var(--om-ink-3); }

#up-phone {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  font-family: var(--om-font-sans);
  color: var(--om-ink-2);
  padding: 0 16px;
  outline: none;
  background: transparent;
}

/* Country picker popover */
.up-cc-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(3,13,78,.12);
  z-index: 200;
  overflow: hidden;
}

.up-cc-pop[aria-hidden="true"] { display: none; }

.up-cc-search {
  width: 100%;
  height: 42px;
  border: none;
  border-bottom: 1px solid var(--om-line);
  font-size: 13px;
  font-family: var(--om-font-sans);
  padding: 0 14px;
  outline: none;
  color: var(--om-ink-2);
}

.up-cc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.up-cc-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--om-ink-2);
  cursor: pointer;
  transition: background 150ms;
}

.up-cc-list li:hover,
.up-cc-list li:focus { background: var(--om-surface-2); outline: none; }

.up-cc-list .cc-flag { font-size: 17px; }
.up-cc-list .cc-name { flex: 1; }
.up-cc-list .cc-dial { color: var(--om-ink-3); font-size: 12px; }

/* ── Consent ─────────────────────────────────────────────────────────── */
.up-check { display: flex; align-items: flex-start; gap: 10px; }

.up-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--om-navy);
  cursor: pointer;
}

.up-check label {
  font-size: 13px;
  color: var(--om-ink-3);
  line-height: 1.5;
  font-weight: 400;
  cursor: pointer;
}

.up-check label a { color: var(--om-blue); }

/* ── Dropzone ────────────────────────────────────────────────────────── */
.up-dropzone {
  border: 2px dashed var(--om-line);
  border-radius: 16px;
  background: #fafbff;
  padding: 32px 22px;
  text-align: center;
  transition: border-color 200ms ease-out, background 200ms ease-out;
}

.up-dropzone.is-hover { border-color: var(--om-blue); background: #f1f7fd; }
.up-dropzone.is-drag  { border-color: var(--om-blue); background: #eaf3fb; }

.up-dz__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 24px;
  color: var(--om-blue);
}

.up-dz__h4 { font-size: 17px; font-weight: 700; color: var(--om-navy); margin-bottom: 6px; }
.up-dz__sub { font-size: 13px; color: var(--om-ink-3); margin-bottom: 18px; line-height: 1.5; }

.up-dz__btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.up-dz__tip {
  background: #f0f7fd;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--om-navy);
  padding: 10px 14px;
  text-align: left;
  line-height: 1.5;
}

/* ── File previews ───────────────────────────────────────────────────── */
.up-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.up-preview-card {
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.up-preview-thumb {
  height: 90px;
  background: repeating-linear-gradient(
    135deg, #f0f4fa 0, #f0f4fa 10px, #e8eef7 10px, #e8eef7 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.up-preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.up-pdf-label { font-size: 13px; font-weight: 700; color: var(--om-ink-3); letter-spacing: .05em; }

.up-preview-meta { padding: 8px 10px; }

.up-preview-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--om-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-preview-size { font-size: 11px; color: var(--om-ink-3); margin-top: 2px; }

.up-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(3,13,78,.85);
  border: none;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* ── Category grid ───────────────────────────────────────────────────── */
.up-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.up-cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 200ms ease-out, background 200ms ease-out, box-shadow 200ms ease-out;
  font-family: var(--om-font-sans);
}

.up-cat-tile:hover { border-color: var(--om-blue); background: #fafbff; }

.up-cat-tile.is-selected {
  border-color: var(--om-blue);
  background: #f1f7fd;
  box-shadow: 0 0 0 3px rgba(3,105,161,.12);
}

.up-cat-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--om-line);
  background: var(--om-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 200ms ease-out;
}

.up-cat-tile.is-selected .up-cat-check {
  background: var(--om-blue);
  border-color: var(--om-blue);
  color: #fff;
}

.up-cat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--om-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--om-navy);
  transition: background 200ms ease-out, color 200ms ease-out;
}

.up-cat-tile.is-selected .up-cat-icon { background: var(--om-blue); color: #fff; }

.up-cat-label { font-size: 13px; font-weight: 700; color: var(--om-navy); }
.up-cat-desc  { font-size: 12px; color: var(--om-ink-3); line-height: 1.4; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.up-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--om-blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--om-font-sans);
  cursor: pointer;
  transition: background 200ms ease-out;
}

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

.up-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--om-surface);
  color: var(--om-navy);
  border: 1px solid var(--om-navy);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--om-font-sans);
  cursor: pointer;
  transition: background 200ms ease-out;
}

.up-btn-outline:hover { background: var(--om-bg); }

.up-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--om-navy);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--om-font-sans);
  cursor: pointer;
  transition: background 200ms ease-out, opacity 200ms ease-out;
  white-space: nowrap;
}

.up-btn-submit:hover   { background: var(--om-navy-deep); }
.up-btn-submit:disabled { opacity: .55; cursor: not-allowed; }

.up-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: up-spin .6s linear infinite;
}

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

/* ── Submit row ──────────────────────────────────────────────────────── */
.up-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px dashed var(--om-line);
  margin-top: 28px;
  padding-top: 22px;
}

.up-trust-inline {
  display: flex;
  gap: 20px;
  font-size: 12.5px;
  color: var(--om-ink-3);
  flex-wrap: wrap;
}

.up-trust-inline span { display: inline-flex; align-items: center; gap: 5px; }

.up-submit-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.up-submit-err { display: none; font-size: 12.5px; color: var(--om-danger); text-align: right; }
.up-submit-err.is-visible { display: block; }

/* ── Trust band ──────────────────────────────────────────────────────── */
.up-trust-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.up-trust-card {
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 16px;
  padding: 18px 20px;
}

.up-trust-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--om-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--om-navy);
  margin-bottom: 12px;
}

.up-trust-card h3 { font-size: 14px; font-weight: 700; color: var(--om-navy); margin-bottom: 6px; }
.up-trust-card p  { font-size: 12.5px; color: var(--om-ink-3); line-height: 1.5; }

/* ── How it works ────────────────────────────────────────────────────── */
.up-how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 32px;
}

.up-how-card {
  background: var(--om-surface);
  border: 1px solid var(--om-line);
  border-radius: 14px;
  padding: 18px;
}

.up-how-num {
  width: 28px;
  height: 28px;
  background: var(--om-navy);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.up-how-card h3 { font-size: 14px; font-weight: 700; color: var(--om-navy); margin-bottom: 6px; }
.up-how-card p  { font-size: 12.5px; color: var(--om-ink-3); line-height: 1.5; }

/* ── Confirmation panel ──────────────────────────────────────────────── */
.up-confirm { text-align: center; padding: 40px 24px; }

.up-confirm__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #F0FDF4; /* success-green tint — no --om-success-bg token */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  color: var(--om-success);
}

.up-confirm__h2 { font-size: 28px; font-weight: 800; color: var(--om-navy); margin-bottom: 12px; }

.up-confirm__body {
  font-size: 14px;
  color: var(--om-ink-2);
  line-height: 1.55;
  max-width: 460px;
  margin: 0 auto 20px;
}

.up-confirm__ref {
  display: inline-block;
  background: #f1f7fd;
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--om-blue);
  margin-bottom: 24px;
}

.up-confirm__reset { margin-top: 8px; }

/* ── Mobile sticky CTA ───────────────────────────────────────────────── */
.up-sticky-cta { display: none; }

/* ── Responsive: tablet 767–991px ───────────────────────────────────── */
@media (max-width: 991px) {
  .up-how-grid { grid-template-columns: repeat(2, 1fr); }
  .up-cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive: mobile < 767px ──────────────────────────────────────── */
@media (max-width: 767px) {
  .up-inner  { padding: 0 16px; }
  .up-crumb  { padding: 14px 16px; }
  .up-crumb__inner { font-size: 12px; }

  .up-wrap { padding: 24px 0 100px; }

  .up-hero { grid-template-columns: 1fr; padding: 16px 0 20px; gap: 0; }
  .up-hero__img { display: none; }
  .up-hero__text h1 { font-size: 24px; margin-bottom: 10px; }
  .up-hero__text p  { font-size: 13.5px; }

  .up-card { padding: 18px; border-radius: 14px; }

  .up-seg__btn { font-size: 13px; padding: 8px 14px; }

  .up-form-grid { grid-template-columns: 1fr; gap: 12px; }

  .up-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .up-cat-desc { display: none; }
  .up-cat-tile { padding: 14px; }

  .up-trust-band {
    display: flex;
    justify-content: space-around;
    gap: 0;
    background: var(--om-surface);
    border: 1px solid var(--om-line);
    border-radius: 12px;
    padding: 12px 8px;
  }
  .up-trust-card { border: none; border-radius: 0; padding: 0 8px; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
  .up-trust-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; margin-bottom: 0; }
  .up-trust-card h3 { font-size: 11px; }
  .up-trust-card p  { display: none; }

  .up-how-grid { grid-template-columns: repeat(2, 1fr); }

  .up-submit-row .up-btn-submit { display: none; }
  .up-submit-right { align-items: flex-start; }

  .up-sticky-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--om-surface);
    border-top: 1px solid var(--om-line);
    box-shadow: 0 -4px 14px rgba(0,0,0,.05);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 100;
  }

  .up-sticky-cta__btn { width: 100%; justify-content: center; }

  .up-sticky-cta--hidden { display: none !important; }
}
