html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* 1. Global Reset & Body Background (Removes white side/bottom gaps) */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    min-height: 100vh;
    background-color: #121212 !important; /* Deep dark background */
    color: #e1e1e1;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
}

/* 2. Responsive Wrapper */
.vc-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background-color: #121212;
    padding: 12px;
    box-sizing: border-box;
}

/* 3. Responsive Card Sizing */
.vc-card {
    background-color: #242424;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    padding: 20px 18px;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Header */
.vc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.vc-brand-icon {
    width: 44px;
    height: 44px;
    background-color: #0d3868;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    flex-shrink: 0;
}

.vc-clinic-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.vc-clinic-phone {
    font-size: 0.82rem;
    color: #8e8e93;
    margin-top: 2px;
}

/* Title & Subtitle */
.vc-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.vc-subtitle {
    font-size: 0.88rem;
    color: #a0a0a5;
    line-height: 1.35;
    margin: 0 0 18px 0;
}

.vc-divider {
    height: 1px;
    background-color: #3a3a3c;
    margin-bottom: 18px;
}

/* Details list */
.vc-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.vc-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.vc-detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8e8e93;
}

.vc-detail-value {
    font-weight: 700;
    color: #ffffff;
    text-align: right;
}

/* 4. Responsive Toggle Buttons (Vertical Stack on mobile, 2-column on >=400px) */
.vc-toggles {
    display: flex;
    flex-direction: column; /* Stacked vertically by default for small screens */
    gap: 10px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
}

.vc-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 400px) {
    .vc-toggles {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Switch to side-by-side when width permits */
        gap: 10px;
    }

    .vc-btn {
        font-size: 0.85rem;
        padding: 11px 8px;
    }
}

/* Accept Button (Green) */
.vc-btn-accept {
    background-color: #0e3a1e;
    color: #34c759;
    border-color: #17522b;
}

.vc-toggle-input#toggleAccept:checked + .vc-btn-accept {
    background-color: #1b5e20;
    color: #ffffff;
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.4);
}

/* Deny Button (Red) */
.vc-btn-deny {
    background-color: #3a1214;
    color: #ff453a;
    border-color: #541d20;
}

.vc-toggle-input#toggleDeny:checked + .vc-btn-deny {
    background-color: #c62828;
    color: #ffffff;
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(255, 69, 58, 0.4);
}

/* Submit Button */
.vc-submit-btn {
    width: 100%;
    padding: 13px;
    border-radius: 8px;
    border: none;
    background-color: #2c5282;
    color: #718096;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.2s ease;
}

.vc-submit-btn:not(:disabled) {
    background-color: #2b6cb0;
    color: #ffffff;
    cursor: pointer;
}

.vc-submit-btn:not(:disabled):hover {
    background-color: #3182ce;
}

/* Hint Text */
.vc-hint {
    font-size: 0.78rem;
    color: #718096;
    text-align: center;
    margin-top: 12px;
    line-height: 1.35;
}

/* Container animation / visibility */
.vc-comment-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    margin-bottom: 0;
}

.vc-comment-container.is-visible {
    max-height: 150px;
    opacity: 1;
    margin-bottom: 14px;
}

/* Label & Textarea styling */
.vc-comment-label {
    display: block;
    font-size: 0.82rem;
    color: #8e8e93;
    margin-bottom: 6px;
}

.vc-textarea {
    width: 100%;
    background-color: #202020;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 10px 12px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.vc-textarea:focus {
    border-color: #3b82f6;
}

.vc-textarea::placeholder {
    color: #636366;
}

/* Optional Comment Box when already decided */
.vc-comment-box {
    margin-top: 16px;
    background-color: #222;
    padding: 12px;
    border-radius: 8px;
}

.vc-comment-text {
    margin: 4px 0 0 0;
    color: #fff;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---- Informed consent (screen + print) ---- */

.consent-form {
    --consent-border: #111;
    --consent-muted: #5b6470;
    --consent-bg: #ffffff;
    --consent-paper: #ffffff;
    --consent-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    --consent-radius: 14px;
    --consent-pad: 28px;
    margin: 18px 0 28px;
}

/* ---- Added for signature font ---- */
.signature-field__input {
    font-family: 'Satisfy', cursive;
    font-size: 1.8rem;
    color: #003366; /* dark ink-like color */
}

.consent-form__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    justify-content: flex-start;
    max-width: 900px;
    margin: 6px auto 14px;
}

.consent-form__hint {
    font-size: 0.95rem;
    color: var(--consent-muted);
}

.consent-form__actions {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px dashed rgba(17, 17, 17, 0.22);
}

.consent-form__actionsHint {
    color: var(--consent-muted);
    font-size: 0.95rem;
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.otp-digit {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.consent-form__page {
    background: var(--consent-paper);
    border: 1px solid rgba(17, 17, 17, 0.10);
    border-radius: var(--consent-radius);
    box-shadow: var(--consent-shadow);
    padding: var(--consent-pad);
    max-width: 900px;
    margin: 0 auto;
    color: #0b0f14;
    line-height: 1.45;
    font-size: 11pt;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.consent-form__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 2px solid rgba(17, 17, 17, 0.18);
}

.consent-form__title {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.2px;
    font-size: 18pt;
}

.consent-form__subtitle {
    margin-top: 4px;
    color: var(--consent-muted);
    font-size: 11pt;
}

.consent-form__section {
    margin: 14px 0;
}

.consent-form__h2 {
    font-size: 12.5pt;
    margin: 14px 0 8px;
    font-weight: 700;
}

.consent-form__list {
    margin: 8px 0 0;
    padding-left: 20px;
}

.consent-form__list li {
    margin: 4px 0;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px 18px;
    align-items: end;
}

@media (max-width: 768px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}

.field {
    display: grid;
    gap: 6px;
}

.field__label {
    font-weight: 700;
    font-size: 10pt;
    color: #1b2430;
}

.field__input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--consent-border);
    background: transparent;
    padding: 6px 2px 5px;
    font-size: 11pt;
}

.field__input--short {
    max-width: 220px;
}

.write-box {
    border: 1px solid var(--consent-border);
    border-radius: 10px;
    padding: 12px 12px;
    background: var(--consent-bg);
}

.write-box__textarea {
    width: 100%;
    min-height: 92px;
    border: 0;
    outline: none;
    background: transparent;
    resize: vertical;
    font: inherit;
    font-size: 11pt;
    line-height: 1.4;
}

.notice {
    margin: 16px 0 4px;
    padding: 12px 14px;
    border-left: 4px solid var(--consent-border);
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.04);
}

.notice__text {
    margin: 0;
    font-weight: 600;
}

.checkbox-section {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: start;
    column-gap: 10px;
}

.checkbox-item__input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: #111;
}

.checkbox-item__label {
    margin: 0;
    cursor: pointer;
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(17, 17, 17, 0.10);
    background: rgba(17, 17, 17, 0.02);
}

.checkbox-item__label:hover {
    background: rgba(17, 17, 17, 0.04);
}

.confirmation {
    max-width: 900px;
    margin: 0 auto;
}

.confirmation__card {
    border-radius: 16px;
    border: 1px solid rgba(17, 17, 17, 0.10);
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    padding: 20px 22px;
}

.confirmation__titleRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.confirmation__title {
    margin: 0;
    font-weight: 900;
    font-size: 18pt;
}

.confirmation__subtitle {
    margin: 6px 0 0;
    color: var(--consent-muted);
}

.confirmation__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.document-preview {
    margin-top: 18px;
}

.visit-toggle {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.visit-toggle__btn {
    min-width: 160px;
    padding: 10px 18px;
    font-weight: 600;
}

/* Mobile improvements */
@media (max-width: 576px) {
    .consent-form {
        --consent-pad: 16px;
        margin: 12px 0 18px;
    }

    .consent-form__toolbar {
        gap: 8px;
    }

    .consent-form__page {
        border-radius: 12px;
    }

    .otp-digit {
        width: 42px;
        height: 50px;
    }

    .checkbox-item {
        grid-template-columns: 32px 1fr;
        column-gap: 12px;
    }

    .checkbox-item__input {
        width: 28px;
        height: 28px;
        margin-top: 4px;
    }

    .checkbox-item__label {
        padding: 12px 12px;
    }
}

.signature-section {
    margin-top: 18px;
}

.signature-line {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px 18px;
    align-items: end;
}

@media (max-width: 768px) {
    .signature-line {
        grid-template-columns: 1fr;
    }
}

.signature-field {
    display: grid;
    gap: 6px;
}

.signature-field__label {
    font-weight: 700;
    font-size: 10pt;
    color: #1b2430;
}

.signature-field__input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--consent-border);
    background: transparent;
    padding: 6px 2px 5px;
    font-size: 11pt;
}

.signature-field--narrow .signature-field__input {
    max-width: 220px;
}

.signature-subsection {
    margin-top: 20px;
}

.signature-note {
    margin: 0 0 8px;
    font-size: 10pt;
    color: var(--consent-muted);
}

.office-use {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 2px solid var(--consent-border);
}

.office-use__title {
    font-size: 12pt;
    margin: 0 0 12px;
    font-weight: 800;
}

.witness-field {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.witness-field__label {
    font-weight: 700;
    font-size: 10pt;
    color: #1b2430;
}

.witness-field__input {
    width: 100%;
    max-width: 540px;
    border: 0;
    border-bottom: 1px solid var(--consent-border);
    background: transparent;
    padding: 6px 2px 5px;
    font-size: 11pt;
}

.disclaimer {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 17, 17, 0.18);
    font-size: 9.5pt;
    color: #5b6470;
}

.keep-together {
    break-inside: avoid;
    page-break-inside: avoid;
}

@media print {
    @page {
        margin: 0.5in;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        margin: 0 !important;
        background-color: #ffffff !important;
    }

    .container {
        max-width: none !important;
    }

    .no-print,
    footer.footer {
        display: none !important;
    }

    .consent-form {
        margin: 0 !important;
    }

    .consent-form__page {
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .document-preview,
    .document-preview[hidden] {
        display: block !important;
    }

    .notice {
        background: transparent !important;
        border-left-width: 3px;
    }

    a[href]:after {
        content: "" !important;
    }
}