@font-face {
    font-family: 'Lipishree';
    src: url('./Lipishree.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0980-U+09FF, U+200C-U+200D, U+20B9, U+25CC, U+A8F1;
}

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

:root {
    --gold: #c9a84c;
    --gold-light: #e8cf80;
    --gold-dark: #8a6a24;
    --cream: #faf7f0;
    --cream-2: #f3ede0;
    --dark: #0d0b09;
    --dark-2: #1a1510;
    --dark-3: #241e16;
    --ink: #1c1510;
    --ink-light: #3a2e22;
    --muted: #9a8570;
    --border: rgba(201, 168, 76, 0.25);
}

body {
    background: #0b0906;
    background-image:
        radial-gradient(ellipse at 50% -10%, rgba(201,168,76,0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 60%,  rgba(201,168,76,0.04) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 80%,  rgba(201,168,76,0.04) 0%, transparent 45%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 3rem;
    font-family: 'Inter', sans-serif;
}

/* ─── PAGE HEADER ─── */
.page-header {
    text-align: center;
    margin-bottom: 1.8rem;
    animation: fadeSlideUp 0.7s ease both;
}
.ph-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(201,168,76,0.45);
    margin-bottom: 0.5rem;
}
.ph-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: -0.5px;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-light) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.45rem;
}
.ph-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(201,168,76,0.35);
}

/* ─── PAGE FOOTER ─── */
.page-footer {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(201,168,76,0.25);
    animation: fadeSlideUp 0.7s ease both;
    animation-delay: 0.8s;
}
.pf-dot { color: rgba(201,168,76,0.15); font-size: 1rem; line-height: 0; }
@media print { .page-header, .page-footer { display: none !important; } }


/* ─── TOP CONTROLS ─── */
.top-controls {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.8rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* ─── THEME TOGGLE ─── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 50px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}
.theme-toggle:hover {
    border-color: rgba(201,168,76,0.45);
    background: rgba(201,168,76,0.04);
}
.tt-icon {
    font-size: 0.7rem;
    line-height: 1;
    user-select: none;
    opacity: 0.7;
}
.tt-track {
    width: 34px;
    height: 18px;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 10px;
    position: relative;
    transition: background 0.35s, border-color 0.35s;
}
.tt-thumb {
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}


/* ══════════════════════════════════════════════
   ✦ DARK CARD THEME — card goes noir
   Toggle adds .dark-card to .rx-card
══════════════════════════════════════════════ */
.rx-card.dark-card {
    background: #1c1710;
    box-shadow:
        0 0 0 1px rgba(201,168,76,0.45),
        0 2px 0 0 rgba(201,168,76,0.2),
        0 30px 60px -10px rgba(0,0,0,0.95),
        0 60px 100px -20px rgba(0,0,0,0.7),
        0 0 100px rgba(201,168,76,0.10),
        0 0 240px rgba(201,168,76,0.06);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
/* Left stripe — darker */
.rx-card.dark-card .left-stripe {
    background: #0f0c08;
}
/* Watermark — slightly brighter on dark */
.rx-card.dark-card .form-body::before {
    color: rgba(201,168,76,0.055);
}
/* Header text */
.rx-card.dark-card .clinic-name {
    color: #f0e8d5;
}
.rx-card.dark-card .clinic-subtitle {
    color: rgba(201,168,76,0.4);
}
.rx-card.dark-card .badge-label {
    color: rgba(201,168,76,0.4);
}
/* Field labels */
.rx-card.dark-card .field-label {
    color: rgba(201,168,76,0.45);
}
/* Field inputs */
.rx-card.dark-card .field-input {
    color: #ede0c4;
    border-bottom-color: rgba(201,168,76,0.2);
}
.rx-card.dark-card .field-input::placeholder {
    color: rgba(201,168,76,0.22);
}
.rx-card.dark-card .field-input:focus {
    border-bottom-color: var(--gold);
    background: rgba(201,168,76,0.03);
}
/* Section & ornament dividers */
.rx-card.dark-card .section-divider {
    background: linear-gradient(90deg, rgba(201,168,76,0.12), rgba(201,168,76,0.06), transparent);
}
.rx-card.dark-card .od-line {
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.22), transparent);
}
.rx-card.dark-card .od-center {
    color: rgba(201,168,76,0.38);
}
/* Prescription zone box */
.rx-card.dark-card .prescription-zone {
    border-color: rgba(201,168,76,0.2);
    background: rgba(201,168,76,0.015);
}
.rx-card.dark-card .pz-tick {
    border-color: rgba(201,168,76,0.45);
}
/* Diagnosis header + labels */
.rx-card.dark-card .diag-label {
    color: rgba(201,168,76,0.45);
}
.rx-card.dark-card .dosage-column {
    border-left-color: rgba(201,168,76,0.18);
}
/* Textareas */
.rx-card.dark-card .diag-textarea {
    color: #ede0c4;
    border-bottom-color: rgba(201,168,76,0.15);
}
.rx-card.dark-card .diag-textarea::placeholder {
    color: rgba(201,168,76,0.22);
}
.rx-card.dark-card .diag-textarea:focus {
    border-bottom-color: var(--gold);
    background: rgba(201,168,76,0.03);
}
/* Rx No input */
.rx-card.dark-card .rxno-input {
    color: #ede0c4;
    border-bottom-color: rgba(201,168,76,0.18);
}
/* Remarks */
.rx-card.dark-card .remarks-strip {
    border-top-color: rgba(201,168,76,0.15);
}
.rx-card.dark-card .remarks-label {
    color: rgba(201,168,76,0.45);
}
.rx-card.dark-card .remarks-input {
    color: #ede0c4;
    border-bottom-color: rgba(201,168,76,0.13);
}
.rx-card.dark-card .remarks-input::placeholder {
    color: rgba(201,168,76,0.2);
}
.rx-card.dark-card .remarks-input:focus {
    border-bottom-color: var(--gold);
}
/* Signature section */
.rx-card.dark-card .signature-section {
    border-top-color: rgba(201,168,76,0.22);
}
.rx-card.dark-card .sig-label-text {
    color: rgba(201,168,76,0.45);
}
.rx-card.dark-card .sig-input {
    color: #ede0c4;
    border-bottom-color: rgba(201,168,76,0.18);
}
.rx-card.dark-card .sig-input:focus {
    border-bottom-color: var(--gold);
}
.rx-card.dark-card .sig-oath {
    color: rgba(201,168,76,0.3);
}
/* Footer bar */
.rx-card.dark-card .rx-footer {
    border-top-color: rgba(201,168,76,0.12);
    color: rgba(201,168,76,0.32);
}
/* Corner ornaments — more visible */
.rx-card.dark-card .corner {
    color: var(--gold);
    opacity: 0.22;
}
/* Stripe text */
.rx-card.dark-card .stripe-text {
    color: rgba(201,168,76,0.4);
}

/* Toggle thumb slides right when active (dark card) */
.theme-toggle.active .tt-thumb {
    transform: translateX(16px);
    background: var(--gold-light);
}
.theme-toggle.active .tt-track {
    background: rgba(201,168,76,0.18);
    border-color: rgba(201,168,76,0.5);
}

@media print { .theme-toggle { display: none !important; } }

.btn-download {
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

/* Primary — solid gold */
.btn-primary {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    color: #1a1408;
    box-shadow: 0 4px 20px rgba(201,168,76,0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201,168,76,0.45);
    filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); }

/* Secondary — outlined */
.btn-secondary {
    background: transparent;
    color: rgba(201,168,76,0.65);
    border: 1px solid rgba(201,168,76,0.28);
}
.btn-secondary:hover {
    background: rgba(201,168,76,0.06);
    border-color: rgba(201,168,76,0.55);
    color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.12);
}
.btn-secondary:active { transform: translateY(0); }

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
}

/* ─── PRESCRIPTION CARD ─── */
.rx-card {
    width: 210mm;
    min-height: 297mm;
    background: var(--cream);
    position: relative;
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(201,168,76,0.35),
        0 2px 0 0 rgba(201,168,76,0.15),
        0 30px 60px -10px rgba(0,0,0,0.9),
        0 60px 100px -20px rgba(0,0,0,0.6),
        0 0 80px  rgba(201,168,76,0.07),
        0 0 200px rgba(201,168,76,0.04);
    overflow: hidden;
    display: flex;
}

/* ─── LEFT ACCENT STRIPE ─── */
.left-stripe {
    width: 10mm;
    background: var(--dark);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.left-stripe::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gold), var(--gold), transparent);
    opacity: 0.6;
}
.stripe-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.42rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.5);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    user-select: none;
}

/* ─── MAIN FORM ─── */
.form-body {
    flex: 1;
    padding: 12mm 14mm 12mm 12mm;
    display: flex;
    flex-direction: column;
    min-height: 297mm;
    position: relative;
}

/* watermark */
.form-body::before {
    content: 'Vondo';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-family: 'Cormorant Garamond', serif;
    font-size: 18rem;
    font-style: italic;
    color: rgba(201, 168, 76, 0.04);
    pointer-events: none;
    user-select: none;
    line-height: 1;
    z-index: 0;
}

/* ─── HEADER ─── */
.rx-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
}

.clinic-name-block {}
.rx-symbol {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    font-weight: 400;
    color: var(--gold-dark);
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.clinic-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.clinic-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 4px;
}

.header-badge {
    text-align: right;
}
.badge-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.42rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
}
.badge-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--gold);
    background: var(--dark);
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.2;
    flex-direction: column;
}
.badge-seal span { display: block; font-size: 0.45rem; letter-spacing: 1px; }

/* Gold rule */
.gold-rule {
    height: 1px;
    background: linear-gradient(90deg, var(--dark) 0%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent 100%);
    margin: 0.8rem 0 1.2rem;
    position: relative;
    z-index: 1;
}
.gold-rule-double {
    height: 3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0.8rem 0 1.4rem;
    position: relative;
    z-index: 1;
}
.gold-rule-double .r1 {
    height: 1.5px;
    background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold) 40%, var(--gold-light) 60%, var(--gold) 80%, transparent 100%);
}
.gold-rule-double .r2 {
    height: 0.5px;
    background: linear-gradient(90deg, transparent, var(--gold-dark) 30%, var(--gold-dark) 70%, transparent);
    opacity: 0.5;
}

/* ─── FIELD GROUPS ─── */
.fields-section {
    position: relative;
    z-index: 1;
}

.field-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.field-group {
    flex: 1;
    min-width: 0;
}

.field-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.48rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 0.35rem;
}

.field-input {
    font-family: 'Caveat', 'Lipishree', 'Noto Sans Bengali', cursive;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100, 80, 55, 0.2);
    width: 100%;
    padding: 0.25rem 0.1rem 0.2rem;
    outline: none;
    transition: border-color 0.2s;
    letter-spacing: 0.2px;
}
.field-input:focus {
    border-bottom-color: var(--gold);
}
.field-input::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    color: rgba(154, 133, 112, 0.5);
    letter-spacing: 0.5px;
}

/* Triage row – 3 columns */
.field-row-3 {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
}
.field-row-3 .field-group {
    flex: 1;
}

/* section bottom border */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, rgba(100,80,55,0.15), rgba(100,80,55,0.08), transparent);
    margin: 0 0 0.5rem;
}

/* ─── ORNAMENT DIVIDER ─── */
.ornament-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0.2rem 0 0.3rem;
    position: relative;
    z-index: 1;
}
.od-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.25), transparent);
}
.od-center {
    font-size: 0.45rem;
    color: rgba(201,168,76,0.5);
    letter-spacing: 5px;
    font-family: 'Inter', sans-serif;
    user-select: none;
    flex-shrink: 0;
}

/* ─── PRESCRIPTION ZONE ─── */
.prescription-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(201,168,76,0.22);
    border-radius: 2px;
    padding: 0.9rem 1rem 0.7rem;
    position: relative;
    z-index: 1;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, rgba(201,168,76,0.018) 0%, transparent 60%);
}

/* bracket corner ticks on the prescription zone */
.pz-tick {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: rgba(201,168,76,0.55);
    border-style: solid;
    border-width: 0;
}
.pz-tl { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.pz-tr { top: -1px; right: -1px; border-top-width: 1.5px; border-right-width: 1.5px; }
.pz-bl { bottom: -1px; left: -1px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.pz-br { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* Rx number inline in header */
.pz-rxno {
    font-family: 'Inter', sans-serif;
    font-size: 0.45rem;
    letter-spacing: 1.5px;
    color: var(--muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.rxno-input {
    font-family: 'Caveat', cursive;
    font-size: 0.85rem;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100,80,55,0.18);
    width: 2.6rem;
    padding: 0 0.1rem;
    outline: none;
    text-align: center;
}
.rxno-input::placeholder { color: rgba(154,133,112,0.4); font-family: 'Inter', sans-serif; font-size: 0.45rem; }

/* Remarks strip */
.remarks-strip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-top: 1px dashed rgba(201,168,76,0.2);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    flex-shrink: 0;
}
.remarks-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.42rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.remarks-input {
    font-family: 'Caveat', 'Lipishree', 'Noto Sans Bengali', cursive;
    font-size: 0.9rem;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100,80,55,0.13);
    flex: 1;
    outline: none;
    padding: 0.1rem 0;
    letter-spacing: 0.2px;
}
.remarks-input::placeholder { font-family: 'Inter', sans-serif; font-size: 0.55rem; color: rgba(154,133,112,0.4); letter-spacing: 0.3px; }
.remarks-input:focus { border-bottom-color: var(--gold); box-shadow: 0 3px 12px rgba(201,168,76,0.1); }

/* ─── DIAGNOSIS SECTION ─── */
.diagnosis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
}
.diagnosis-tag {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    font-style: italic;
    font-weight: 500;
    color: var(--gold-dark);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.diagnosis-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(201,168,76,0.3), transparent);
}

.diagnosis-dual {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    flex: 1;
    align-items: stretch;
    margin-bottom: 0;
    min-height: 0;
}

.med-column {
    flex: 1 1 50%;
    width: 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-right: 1.2rem;
}
.dosage-column {
    flex: 1 1 50%;
    width: 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-left: 1.2rem;
    border-left: 1px solid rgba(201, 168, 76, 0.2);
}

.diag-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.48rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.diag-label-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.diag-textarea {
    font-family: 'Caveat', 'Lipishree', 'Noto Sans Bengali', cursive;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100, 80, 55, 0.15);
    width: 100%;
    padding: 0.3rem 0.1rem 0.2rem;
    outline: none;
    resize: none;
    line-height: 1.5;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 3.5rem;
    letter-spacing: 0.2px;
    transition: border-color 0.2s;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.diag-textarea:focus {
    border-bottom-color: var(--gold);
}
.diag-textarea::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    color: rgba(154, 133, 112, 0.4);
    letter-spacing: 0.3px;
}

/* ─── SIGNATURE ─── */
.signature-section {
    border-top: 1px solid rgba(201, 168, 76, 0.3);
    padding-top: 1.2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}
.sig-block {
    flex: 2;
}
.sig-date-block {
    flex: 1;
}
.sig-label-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.4rem;
    display: block;
}
.sig-input {
    font-family: 'Caveat', 'Lipishree', 'Noto Sans Bengali', cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100, 80, 55, 0.25);
    width: 100%;
    padding: 0.15rem 0;
    outline: none;
    letter-spacing: 0.5px;
}
.sig-input:focus { border-bottom-color: var(--gold); }
.sig-input::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    color: rgba(154, 133, 112, 0.4);
    letter-spacing: 0.5px;
}
.sig-oath {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.6rem;
    color: rgba(154, 133, 112, 0.65);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

/* ─── FOOTER ─── */
.rx-footer {
    margin-top: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}
.footer-left {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.6rem;
    color: rgba(154, 133, 112, 0.5);
    letter-spacing: 1px;
}
.footer-right {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    color: rgba(154, 133, 112, 0.5);
}

/* spacer to push sig to bottom */
.flex-spacer { flex: 1; }

/* ─── RESPONSIVE ─── */
@media (max-width: 800px) {
    .rx-card { width: 100%; min-height: unset; }
    .form-body { padding: 8mm 6mm; }
    .diagnosis-dual { flex-direction: column; }
    .med-column { padding-right: 0; padding-bottom: 1rem; border-bottom: 1px solid rgba(201,168,76,0.2); }
    .dosage-column { padding-left: 0; border-left: none; padding-top: 1rem; }
}

@media print {
    @page {
        size: 210mm 297mm;
        margin: 0mm;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    html {
        width: 210mm;
        height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
    }
    body {
        width: 210mm;
        height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
        background: white;
        display: block !important;
        align-items: unset !important;
        justify-content: unset !important;
    }
    .top-controls { display: none !important; }
    #heartsContainer { display: none !important; }
    .corner, .heartbeat-line, .wax-seal { display: none !important; }

    .rx-card {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        min-height: unset !important;
        max-height: 297mm !important;
        overflow: hidden !important;
        margin: 0 !important;
    }
    .form-body {
        min-height: unset !important;
        height: 100% !important;
        max-height: 297mm !important;
        overflow: hidden !important;
    }
    .left-stripe { display: flex !important; }
    /* Disable all animations in print */
    * { animation: none !important; transition: none !important; }
}

/* ═══════════════════════════════════════════
   ✦ KEYFRAME ANIMATIONS
═══════════════════════════════════════════ */

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes floatHeart {
    0%   { transform: translateY(0) scale(1); opacity: 0.8; }
    50%  { transform: translateY(-45vh) scale(1.1) rotate(10deg); opacity: 0.5; }
    100% { transform: translateY(-95vh) scale(0.6) rotate(-5deg); opacity: 0; }
}

@keyframes hbDraw {
    from { stroke-dashoffset: 600; }
    to   { stroke-dashoffset: 0; }
}

@keyframes sealPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139,60,30,0.3), inset 0 2px 4px rgba(0,0,0,0.3); }
    50%       { box-shadow: 0 0 12px 4px rgba(139,60,30,0.25), inset 0 2px 4px rgba(0,0,0,0.3); }
}

@keyframes goldGlow {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 2px 16px rgba(201,168,76,0.18); }
}

/* ═══════════════════════════════════════════
   ✦ GOLD SHIMMER on header rule
═══════════════════════════════════════════ */
.gold-rule-double .r1 {
    background: linear-gradient(
        90deg,
        var(--gold-dark) 0%,
        var(--gold) 30%,
        var(--gold-light) 48%,
        #fff9e6 50%,
        var(--gold-light) 52%,
        var(--gold) 70%,
        transparent 100%
    );
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

/* ═══════════════════════════════════════════
   ✦ FIELD FOCUS GLOW
═══════════════════════════════════════════ */
.field-input:focus,
.diag-textarea:focus,
.sig-input:focus {
    border-bottom-color: var(--gold) !important;
    box-shadow: 0 4px 18px rgba(201,168,76,0.12);
    background: rgba(201,168,76,0.03);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ═══════════════════════════════════════════
   ✦ FADE-IN ON LOAD
═══════════════════════════════════════════ */
.rx-header        { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.05s; }
.gold-rule-double { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.15s; }
.fields-section   { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.25s; }
.section-divider  { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.3s;  }
.ornament-divider { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.34s; }
.heartbeat-line   { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.38s; }
.prescription-zone{ animation: fadeSlideUp 0.6s ease both; animation-delay: 0.48s; }
.signature-section{ animation: fadeSlideUp 0.6s ease both; animation-delay: 0.62s; }
.rx-footer        { animation: fadeSlideUp 0.6s ease both; animation-delay: 0.72s; }

/* ═══════════════════════════════════════════
   ✦ CORNER ORNAMENTS
═══════════════════════════════════════════ */
.corner {
    position: absolute;
    font-size: 1.1rem;
    color: var(--gold);
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
    z-index: 3;
    line-height: 1;
}
.corner-tl { top: 14mm; left:  14mm; transform: rotate(0deg); }
.corner-tr { top: 14mm; right: 14mm; transform: rotate(90deg); }
.corner-bl { bottom: 14mm; left:  14mm; transform: rotate(270deg); }
.corner-br { bottom: 14mm; right: 14mm; transform: rotate(180deg); }

/* ═══════════════════════════════════════════
   ✦ HEARTBEAT LINE
═══════════════════════════════════════════ */
.heartbeat-line {
    width: 100%;
    height: 26px;
    margin: 0 0 0.35rem;
}
.heartbeat-line svg {
    width: 100%;
    height: 100%;
}
.heartbeat-line polyline {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: hbDraw 1.8s ease forwards;
    animation-delay: 0.5s;
}

/* ═══════════════════════════════════════════
   ✦ WAX SEAL
═══════════════════════════════════════════ */
.wax-seal {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #b84a28, #7a2a10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: sealPulse 3s ease-in-out infinite;
    position: relative;
}
.wax-seal::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1px solid rgba(255,200,150,0.25);
}
.wax-seal-inner {
    font-family: 'Playfair Display', serif;
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255,235,200,0.9);
    text-align: center;
    line-height: 1.3;
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════
   ✦ FLOATING HEARTS
═══════════════════════════════════════════ */
#heartsContainer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.floating-heart {
    position: absolute;
    bottom: -40px;
    font-size: 1rem;
    animation: floatHeart linear infinite;
    opacity: 0;
    user-select: none;
    pointer-events: none;
}
