/* ==========================================================================
   Appointment popup - styling mirrors the inline .appointment-card on the
   homepage (teal accent, gold submit button) so the popup feels native.
   ========================================================================== */

.apt-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

/* Author `display:flex` above outranks the browser's [hidden] rule, so the
   hidden state has to be restated here. */
.apt-modal[hidden] {
    display: none;
}

.apt-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.apt-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: auto;
    background: #ffffff;
    border-radius: 20px;
    border-top: 5px solid #3ebad0;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.35);
    padding: 2.5rem 2.25rem;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.apt-modal.is-open .apt-modal__dialog {
    transform: translateY(0) scale(1);
}

.apt-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.apt-modal__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.apt-modal__title {
    color: #0f172a;
    font-family: var(--title-font);
    font-weight: 700;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
    margin: 0 0 0.4rem;
    position: relative;
    display: inline-block;
}

.apt-modal__title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: #3ebad0;
    border-radius: 2px;
}

.apt-modal__subtitle {
    color: #64748b;
    font-size: 0.92rem;
    margin: 1.25rem 0 1.75rem;
}

/* ----- Fields ----- */
.apt-field {
    margin-bottom: 1rem;
}

.apt-field__label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

.apt-input {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--body-font);
    color: #0f172a;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.apt-input::placeholder {
    color: #64748b;
    opacity: 1;
}

.apt-input:focus {
    border-color: #3ebad0;
    box-shadow: 0 0 0 4px rgba(62, 186, 208, 0.15);
    outline: none;
}

select.apt-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    padding-right: 45px;
    cursor: pointer;
}

textarea.apt-input {
    resize: vertical;
    min-height: 90px;
}

.apt-row {
    display: flex;
    gap: 1rem;
}

.apt-row > .apt-field {
    flex: 1;
    min-width: 0;
}

/* Honeypot - hidden from humans, bots still fill it */
.apt-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ----- Submit ----- */
.apt-submit {
    width: 100%;
    background: linear-gradient(135deg, #f2d06b 0%, #e5b83b 100%);
    color: #0f172a;
    border: none;
    border-radius: 30px;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px -6px rgba(242, 208, 107, 0.6);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, opacity 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0.5rem;
}

.apt-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(242, 208, 107, 0.8);
}

.apt-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ----- Status message ----- */
.apt-status {
    display: none;
    margin-top: 1rem;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.apt-status.is-success {
    display: block;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.apt-status.is-error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Success view replaces the form entirely */
.apt-done {
    display: none;
    text-align: center;
    padding: 1rem 0;
}

.apt-done__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: #ecfdf5;
    color: #10b981;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apt-done__title {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.apt-done__text {
    color: #64748b;
    font-size: 0.95rem;
}

.apt-modal.is-done .apt-modal__form,
.apt-modal.is-done .apt-modal__subtitle {
    display: none;
}

.apt-modal.is-done .apt-done {
    display: block;
}

/* Prevent the page behind the popup from scrolling */
body.apt-modal-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .apt-modal__dialog {
        padding: 2rem 1.35rem;
        border-radius: 16px;
    }

    .apt-modal__title {
        font-size: 1.45rem;
    }

    .apt-row {
        display: block;
    }
}
