/* =====================================================
   RX Prescription Upload – Frontend Styles
   Brand: #F36C24 (orange) · #5DAA45 (green) · #0C3254 (navy)
   Fonts: Helvetica (h1) · Montserrat (body)
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ── CSS Variables ───────────────────────────────── */
:root {
  --rx-orange:      #F36C24;
  --rx-orange-dk:   #D4550A;
  --rx-green:       #5DAA45;
  --rx-green-dk:    #4A8A36;
  --rx-navy:        #0C3254;
  --rx-navy-lt:     #1a4a72;
  --rx-white:       #FFFFFF;
  --rx-bg:          #F4F8F5;
  --rx-border:      #D9E8D9;
  --rx-text:        #2D3B2D;
  --rx-text-muted:  #607860;
  --rx-shadow:      0 4px 24px rgba(12,50,84,.10);
  --rx-shadow-lg:   0 12px 48px rgba(12,50,84,.16);
  --rx-radius:      12px;
  --rx-font-body:   'Montserrat', sans-serif;
  --rx-font-head:   Helvetica, Arial, sans-serif;
  --rx-transition:  0.22s ease;
}

/* ── Wrapper ─────────────────────────────────────── */
.rx-upload-wrapper {
  font-family: var(--rx-font-body);
  color: var(--rx-text);
  background: var(--rx-bg);
  border-radius: var(--rx-radius);
  padding: 48px 24px 56px;
  max-width: 1120px;
  margin: 0 auto;
}

/* ── Section Header ──────────────────────────────── */
.rx-section-header {
  text-align: center;
  margin-bottom: 32px;
}

.rx-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EAF5E7;
  color: var(--rx-green);
  border: 1px solid #C4E0BC;
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.rx-main-title {
  font-family: var(--rx-font-head);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  color: var(--rx-navy);
  margin: 0 0 10px;
  line-height: 1.2;
}

.rx-subtitle {
  font-size: 16px;
  color: var(--rx-text-muted);
  margin: 0;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Trust Bar ───────────────────────────────────── */
.rx-trust-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding: 20px 24px;
  background: var(--rx-white);
  border-radius: 100px;
  border: 1px solid var(--rx-border);
  box-shadow: 0 2px 8px rgba(93,170,69,.08);
}

.rx-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rx-navy);
}

.rx-trust-item svg {
  color: var(--rx-green);
  flex-shrink: 0;
}

/* ── Form Card Layout ────────────────────────────── */
.rx-form-card {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 880px) {
  .rx-form-card { grid-template-columns: 1fr; }
}

.rx-form-card__inner {
  background: var(--rx-white);
  border-radius: var(--rx-radius);
  box-shadow: var(--rx-shadow);
  padding: 36px 40px 40px;
  border: 1px solid var(--rx-border);
}

@media (max-width: 600px) {
  .rx-form-card__inner { padding: 24px 20px 28px; }
}

/* ── Step Sections ───────────────────────────────── */
.rx-step {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid #eef4ee;
}

.rx-step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.rx-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.rx-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--rx-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--rx-font-head);
}

.rx-step-title {
  font-family: var(--rx-font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--rx-navy);
  margin: 0;
}

/* ── Field Grid ──────────────────────────────────── */
.rx-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 600px) {
  .rx-field-grid { grid-template-columns: 1fr; }
}

.rx-field { display: flex; flex-direction: column; gap: 6px; }
.rx-field--full { grid-column: 1 / -1; }

/* ── Labels & Inputs ─────────────────────────────── */
.rx-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rx-navy);
  letter-spacing: 0.2px;
}

.rx-required { color: var(--rx-orange); }

.rx-input,
.rx-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid var(--rx-border);
  border-radius: 8px;
  font-family: var(--rx-font-body);
  font-size: 14px;
  color: var(--rx-text);
  background: #FAFEFA;
  transition: border-color var(--rx-transition), box-shadow var(--rx-transition);
  outline: none;
}

.rx-input:focus,
.rx-textarea:focus {
  border-color: var(--rx-green);
  box-shadow: 0 0 0 3px rgba(93,170,69,.15);
  background: #fff;
}

.rx-input--date { cursor: pointer; }

.rx-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ── Dropzone ────────────────────────────────────── */
.rx-dropzone {
  border: 2px dashed var(--rx-border);
  border-radius: 12px;
  background: #f8fbf8;
  position: relative;
  cursor: pointer;
  transition: border-color var(--rx-transition), background var(--rx-transition);
  overflow: hidden;
}

.rx-dropzone:hover,
.rx-dropzone.rx-drag-over {
  border-color: var(--rx-green);
  background: #f0f9ec;
}

.rx-dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.rx-dropzone__content {
  padding: 36px 24px;
  text-align: center;
  pointer-events: none;
}

.rx-dropzone__icon {
  margin-bottom: 14px;
  color: var(--rx-green);
  display: flex;
  justify-content: center;
}

.rx-dropzone__primary {
  font-size: 15px;
  font-weight: 600;
  color: var(--rx-navy);
  margin: 0 0 4px;
}

.rx-dropzone__secondary {
  font-size: 13px;
  color: var(--rx-text-muted);
  margin: 0 0 14px;
}

.rx-file-types {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.rx-file-types span {
  background: #E3F0E0;
  color: var(--rx-green-dk);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.rx-dropzone__limit {
  font-size: 12px;
  color: var(--rx-text-muted);
  margin: 0;
}

.rx-dropzone__preview {
  padding: 16px;
}

.rx-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--rx-white);
  border: 1px solid var(--rx-border);
  border-radius: 8px;
}

.rx-file-card__icon {
  font-size: 28px;
  flex-shrink: 0;
}

.rx-file-card__info {
  flex: 1;
  min-width: 0;
}

.rx-file-card__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--rx-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rx-file-card__size {
  display: block;
  font-size: 12px;
  color: var(--rx-text-muted);
  margin-top: 2px;
}

.rx-file-card__remove {
  background: #FFECEC;
  border: none;
  color: #C0392B;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--rx-transition);
  z-index: 3;
  position: relative;
}

.rx-file-card__remove:hover { background: #FFD5D5; }

.rx-upload-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--rx-text-muted);
  margin-top: 12px;
  line-height: 1.6;
}

.rx-upload-note svg { color: var(--rx-green); flex-shrink: 0; margin-top: 1px; }

/* ── Checkbox ────────────────────────────────────── */
.rx-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 20px;
}

.rx-checkbox { display: none; }

.rx-checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--rx-border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  background: #fafefa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--rx-transition);
}

.rx-checkbox:checked ~ .rx-checkbox-custom {
  background: var(--rx-green);
  border-color: var(--rx-green);
}

.rx-checkbox:checked ~ .rx-checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.rx-checkbox-text {
  font-size: 13px;
  color: var(--rx-text-muted);
  line-height: 1.6;
}

.rx-checkbox-text a {
  color: var(--rx-green);
  text-decoration: underline;
}

/* ── Alert ───────────────────────────────────────── */
.rx-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.rx-alert--error {
  background: #FFF0ED;
  border: 1px solid #F9CFC7;
  color: #9E2A0A;
}

.rx-alert--error svg { flex-shrink: 0; color: #E53A1E; margin-top: 1px; }

/* ── Submit Button ───────────────────────────────── */
.rx-submit-btn {
  width: 100%;
  background: var(--rx-orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 28px;
  font-family: var(--rx-font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--rx-transition), transform var(--rx-transition), box-shadow var(--rx-transition);
  box-shadow: 0 4px 16px rgba(243,108,36,.35);
  letter-spacing: 0.3px;
}

.rx-submit-btn:hover:not(:disabled) {
  background: var(--rx-orange-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(243,108,36,.45);
}

.rx-submit-btn:active { transform: translateY(0); }
.rx-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.rx-submit-btn__text,
.rx-submit-btn__loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Spinner ─────────────────────────────────────── */
.rx-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rx-spin 0.7s linear infinite;
}

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

/* ── Sidebar ─────────────────────────────────────── */
.rx-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rx-sidebar__card {
  background: var(--rx-white);
  border-radius: var(--rx-radius);
  padding: 24px;
  border: 1px solid var(--rx-border);
  box-shadow: var(--rx-shadow);
}

.rx-sidebar__card--accent {
  background: #EAF5E7;
  border-color: #C4E0BC;
}

.rx-sidebar__card--help {
  background: #FFF4EE;
  border-color: #F9CFA8;
}

.rx-sidebar__title {
  font-family: var(--rx-font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--rx-navy);
  margin: 0 0 16px;
}

.rx-how-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rx-how-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rx-how-list__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rx-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--rx-font-head);
}

.rx-how-list strong {
  font-size: 13px;
  color: var(--rx-navy);
  display: block;
  margin-bottom: 2px;
}

.rx-how-list p {
  font-size: 12px;
  color: var(--rx-text-muted);
  margin: 0;
  line-height: 1.5;
}

.rx-format-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rx-format-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rx-navy);
  font-weight: 500;
}

.rx-format-note {
  font-size: 11px;
  color: var(--rx-text-muted);
  margin: 0;
}

.rx-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rx-orange);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
  transition: background var(--rx-transition);
}

.rx-phone-link:hover { background: var(--rx-orange-dk); color: #fff; }

/* ── Success Modal ───────────────────────────────── */
.rx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12,50,84,.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: rx-fadein 0.2s ease;
}

@keyframes rx-fadein { from { opacity: 0; } to { opacity: 1; } }

.rx-modal {
  background: #fff;
  border-radius: 18px;
  padding: 44px 40px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--rx-shadow-lg);
  animation: rx-slideup 0.28s cubic-bezier(.17,.67,.35,1.1);
}

@keyframes rx-slideup {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.rx-modal__icon-wrap {
  margin-bottom: 20px;
}

.rx-modal__icon {
  width: 64px;
  height: 64px;
}

.rx-modal__title {
  font-family: var(--rx-font-head);
  font-size: 24px;
  color: var(--rx-navy);
  margin: 0 0 10px;
}

.rx-modal__body {
  font-size: 14px;
  color: var(--rx-text-muted);
  margin: 0 0 24px;
  line-height: 1.7;
}

.rx-modal__ref-box {
  background: linear-gradient(135deg, #f0f9ec, #e8f5e0);
  border: 2px solid var(--rx-green);
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 16px;
}

.rx-modal__ref-label {
  font-size: 11px;
  color: var(--rx-green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 6px;
}

.rx-modal__ref-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--rx-navy);
  letter-spacing: 3px;
  margin: 0;
  font-family: var(--rx-font-head);
}

.rx-modal__note {
  font-size: 12px;
  color: var(--rx-text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

.rx-modal__close {
  background: var(--rx-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--rx-font-body);
  cursor: pointer;
  transition: background var(--rx-transition);
}

.rx-modal__close:hover { background: var(--rx-green-dk); }
