/* /css/consent.css - Patient Consent Form page */

/* ==========================================================================
   Hero
   ========================================================================== */
.consent-hero {
    background-color: var(--deep-navy);
    color: var(--ivory);
    margin-top: 65px;
    padding: 4rem 4rem 3.5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.consent-hero::before {
    content: '';
    position: absolute;
    top: -45%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.16) 0%, rgba(13, 27, 62, 0) 70%);
    border-radius: 50%;
}

.consent-hero>* {
    position: relative;
    z-index: 1;
}

.consent-hero .hero-eyebrow {
    color: var(--sovereign-gold);
    font-size: 1rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.consent-hero h1 {
    color: var(--ivory);
    font-size: 3.2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.consent-hero p {
    color: rgba(250, 247, 242, 0.8);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto;
}

/* ==========================================================================
   Form section
   ========================================================================== */
.consent-section {
    padding: 4rem 1.5rem 5rem;
    background-color: var(--ivory);
}

.consent-card {
    max-width: 720px;
    margin: -5rem auto 0;
    background-color: #fff;
    border: 1px solid rgba(13, 27, 62, 0.08);
    border-radius: 16px;
    padding: 2.75rem;
    position: relative;
    z-index: 2;
}

.consent-card-head {
    margin-bottom: 2rem;
}

.consent-card-head h2 {
    font-size: 2rem;
    line-height: 1.2;
    color: var(--deep-navy);
    margin-bottom: 0.4rem;
}

.consent-card-head p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Fields */
.consent-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.consent-form .form-group {
    margin-bottom: 1.25rem;
}

.consent-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--deep-navy);
    margin-bottom: 0.5rem;
}

.required-star {
    color: var(--sovereign-gold);
}

.consent-form input[type="text"],
.consent-form input[type="tel"],
.consent-form input[type="email"] {
    width: 100%;
    height: 40px;
    padding: 0 1rem;
    border: 1px solid rgba(13, 27, 62, 0.15);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--charcoal);
    background-color: #fafafa;
    transition: all 0.25s ease;
}

.consent-form input:focus {
    outline: none;
    border-color: var(--sovereign-gold);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.1);
}

/* Searchable service dropdown styles are global - see css/style.css */

/* ==========================================================================
   Terms acceptance row
   ========================================================================== */
.consent-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background-color: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
}

.consent-terms-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid rgba(13, 27, 62, 0.3);
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    margin-top: 1px;
    transition: all 0.2s ease;
    position: relative;
    cursor: not-allowed;
}

.consent-terms-check.checked {
    cursor: default;
}

.consent-terms-check:not(.checked):hover::after {
    content: "Read and accept first the terms and privacy";
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.consent-terms-check:not(.checked):hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
    z-index: 100;
    pointer-events: none;
}

.consent-terms-check.checked {
    background-color: var(--sovereign-gold);
    border-color: var(--sovereign-gold);
    color: var(--deep-navy);
}

.consent-terms-check i,
.consent-terms-check svg {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

.consent-terms-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #444;
}

.consent-terms-text .terms-link {
    color: var(--sovereign-gold);
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}

/* ==========================================================================
   Buttons + OTP + messages
   ========================================================================== */
.consent-btn {
    width: 100%;
    height: 52px;
    border-radius: 50px;
    background-color: var(--sovereign-gold);
    color: var(--deep-navy);
    border: 1.5px solid var(--sovereign-gold);
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.25s ease, opacity 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.consent-btn:hover {
    background-color: #d8bb63;
}

.consent-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.consent-form-error {
    color: #c0392b;
    font-size: 0.88rem;
    margin-top: 0.85rem;
    text-align: center;
    min-height: 1.1rem;
}

/* OTP block */
.consent-otp {
    margin-top: 1.5rem;
    border-top: 1px dashed rgba(13, 27, 62, 0.15);
    padding-top: 1.5rem;
    display: none;
}

.consent-otp.show {
    display: block;
}

.otp-demo-note {
    background-color: var(--deep-navy);
    color: var(--ivory);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.otp-demo-note i,
.otp-demo-note svg {
    color: var(--sovereign-gold);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.otp-demo-note strong {
    color: var(--sovereign-gold);
    letter-spacing: 3px;
    font-size: 1rem;
}

.otp-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.otp-input-row input {
    flex: 1;
    text-align: center;
    letter-spacing: 8px;
    font-size: 1.2rem;
    font-weight: 500;
}

.otp-input-row .consent-btn {
    width: auto;
    padding: 0 1.75rem;
    flex-shrink: 0;
}

.otp-resend {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.otp-resend button {
    background: none;
    border: none;
    color: var(--sovereign-gold);
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

/* Success state */
.consent-success {
    display: none;
    text-align: center;
    padding: 1rem 0;
}

.consent-success.show {
    display: block;
}

.consent-success-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(201, 168, 76, 0.15);
    color: var(--sovereign-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.consent-success-icon i,
.consent-success-icon svg {
    width: 36px;
    height: 36px;
}

.consent-success h2 {
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--deep-navy);
    margin-bottom: 0.6rem;
}

.consent-success p {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto;
}

/* ==========================================================================
   Terms modal
   ========================================================================== */
.terms-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(13, 27, 62, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.terms-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.terms-modal {
    background-color: var(--ivory);
    border-radius: 14px;
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.terms-modal-overlay.active .terms-modal {
    transform: translateY(0);
}

.terms-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid rgba(13, 27, 62, 0.08);
    background-color: #fff;
}

.terms-modal-header h3 {
    font-size: 1.4rem;
    color: var(--deep-navy);
}

.terms-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--charcoal);
    display: flex;
}

.terms-modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}

/* The modal header already shows the title - hide the duplicate heading
   and its top "Last Updated" line (kept in the shared partial for the
   legal page). The date is shown at the bottom instead. */
.terms-modal-body>h2,
.terms-modal-body>h2+p {
    display: none;
}

.terms-updated-header {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: #888;
}

.terms-updated-header strong {
    color: var(--charcoal);
}

.terms-modal-body h3 {
    font-size: 1rem;
    color: var(--deep-navy);
    margin: 1.5rem 0 0.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* First visible heading sits flush with the body padding (no extra top gap) */
.terms-modal-body h3:first-of-type {
    margin-top: 0;
}

.terms-modal-body p {
    color: #555;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.terms-modal-body ul {
    margin: 0 0 0.75rem 1.25rem;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.7;
}

.terms-modal-body a {
    color: var(--sovereign-gold);
}

.terms-modal-footer {
    padding: 1.1rem 1.75rem;
    border-top: 1px solid rgba(13, 27, 62, 0.08);
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.terms-scroll-hint {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.terms-scroll-hint i,
.terms-scroll-hint svg {
    width: 15px;
    height: 15px;
}

.terms-accept-btn {
    height: 46px;
    padding: 0 1.75rem;
    border-radius: 50px;
    background-color: var(--sovereign-gold);
    color: var(--deep-navy);
    border: none;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.25s ease, background-color 0.25s ease;
}

.terms-accept-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
    .consent-hero {
        padding: 3.5rem 1.25rem 3rem;
    }

    .consent-hero h1 {
        font-size: 2.2rem !important;
    }

    .consent-card-head h2,
    .consent-success h2 {
        font-size: 1.8rem !important;
    }

    .consent-card {
        padding: 1.75rem 1.25rem;
    }

    .consent-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .otp-input-row {
        flex-direction: column;
    }

    .otp-input-row .consent-btn {
        width: 100%;
    }

    .terms-modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .terms-accept-btn {
        width: 100%;
    }
}