/**
 * Novavia — Booking plugin companions.
 *
 * Brand alignment for Amelia and Bookly. Both plugins ship their own
 * appearance panels (Amelia > Settings > Customization, Bookly > Appearance)
 * which remain the source of truth for colors; this file only fixes what those
 * panels cannot: font inheritance and small theme-consistent refinements.
 *
 * Selector notes (verified against Amelia 2.4.x source):
 * - Frontend root is #amelia-container.am-fs__wrapper (NOT .amelia-app-booking).
 * - All Amelia type funnels through the --am-font-family CSS variable, which
 *   Amelia sets INLINE via cssVars — hence the !important overrides below.
 */

/* ------------------------------------------------------------------
 * 1. Typeface — override Amelia's font variable + theme heading font
 * ------------------------------------------------------------------ */
#amelia-container {
    --am-font-family: "Inter", "Segoe UI", sans-serif !important;
    font-family: var(--am-font-family);
    color: var(--novavia-ink);
}

#amelia-container h1,
#amelia-container h2,
#amelia-container h3,
#amelia-container h4,
#amelia-container h5,
#amelia-container h6 {
    font-family: "Sora", "Segoe UI", sans-serif !important;
    color: var(--novavia-ink);
    letter-spacing: -0.01em;
}

/* Elementor/Bookly roots (kept for compatibility). */
.bookly-form {
    font-family: inherit;
    color: var(--novavia-ink);
}
.bookly-form h1,
.bookly-form h2,
.bookly-form h3,
.bookly-form h4 {
    font-family: var(--novavia-font-head);
    color: var(--novavia-ink);
}

/* ------------------------------------------------------------------
 * 2. Form controls — match theme inputs
 * ------------------------------------------------------------------ */
#amelia-container .el-input__inner,
#amelia-container .el-textarea__inner,
#amelia-container select,
#amelia-container input[type="text"],
#amelia-container input[type="email"],
#amelia-container input[type="tel"],
#amelia-container textarea {
    border-radius: 12px !important;
    border-color: var(--novavia-border);
    font-family: var(--am-font-family);
}
#amelia-container .el-input__inner:focus,
#amelia-container .el-textarea__inner:focus,
#amelia-container select:focus,
#amelia-container input:focus,
#amelia-container textarea:focus {
    border-color: var(--novavia-primary) !important;
    box-shadow: 0 0 0 3px var(--novavia-primary-soft);
    outline: none;
}

/* ------------------------------------------------------------------
 * 3. Brand accents — gentle, never fighting the plugin's own settings
 * ------------------------------------------------------------------ */

/* Primary buttons pick up the clinic teal. */
#amelia-container .am-fs__btn--primary,
#amelia-container .el-button--primary {
    background: var(--novavia-primary) !important;
    border-color: var(--novavia-primary) !important;
    border-radius: 999px !important;
    font-family: "Sora", "Segoe UI", sans-serif !important;
    font-weight: 600;
}

/* Selected day / time-slot states pick up the clinic teal. */
#amelia-container .am-selected {
    background: var(--novavia-primary-soft);
}

/* Links inside booking flows follow the theme accent. */
#amelia-container a,
.bookly-form a {
    color: var(--novavia-primary);
}

/* ------------------------------------------------------------------
 * 4. Booking page layout helper (theme-owned, always safe)
 * ------------------------------------------------------------------ */
.novavia-booking-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 48px 24px;
}

.novavia-booking-wrap .novavia-booking-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}

.novavia-booking-wrap .novavia-booking-intro h1,
.novavia-booking-wrap .novavia-booking-intro h2 {
    margin-bottom: 12px;
}

/* ------------------------------------------------------------------
 * 5. Small screens
 * ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .novavia-booking-wrap {
        padding: 32px 16px;
    }
}

/* ------------------------------------------------------------------
 * 6. Appointment receipt (injected after successful booking)
 * ------------------------------------------------------------------ */
.nv-receipt {
    background: #fff;
    border: 1px solid #E8E2D5;
    border-radius: 20px;
    padding: 32px;
    margin-top: 24px;
    box-shadow: 0 12px 32px rgba(14, 58, 58, 0.08);
    font-family: "Inter", sans-serif;
}

.nv-receipt-head h3 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 30px;
    font-weight: 600;
    color: #0E3A3A;
    margin: 0 0 6px;
}

.nv-receipt-head p {
    margin: 0 0 20px;
    color: #64748B;
    font-size: 15px;
}

.nv-receipt-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px 16px;
    margin: 0 0 24px;
    padding: 0;
}

.nv-receipt-list dt {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #8A94A6;
    padding: 8px 0;
    border-bottom: 1px solid #F1EDE2;
}

.nv-receipt-list dd {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #1E293B;
    padding: 8px 0;
    border-bottom: 1px solid #F1EDE2;
}

.nv-receipt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nv-receipt-btn {
    font-family: "Sora", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #0E7C7B;
    border: 2px solid #0E7C7B;
    border-radius: 999px;
    padding: 12px 28px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.nv-receipt-btn:hover {
    background: #0A5E5D;
    transform: translateY(-1px);
}

.nv-receipt-btn-outline {
    background: transparent;
    color: #0E7C7B;
}

.nv-receipt-btn-outline:hover {
    background: rgba(14, 124, 123, 0.08);
}

@media (max-width: 640px) {
    .nv-receipt {
        padding: 24px 20px;
    }
    .nv-receipt-list {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .nv-receipt-list dt {
        border-bottom: none;
        padding-bottom: 0;
    }
}

/* ------------------------------------------------------------------
 * 7. Booking dropdowns/pickers (Element Plus teleports these to <body>,
 *    outside #amelia-container — scope via body.novavia-booking)
 * ------------------------------------------------------------------ */
body.novavia-booking .el-select-dropdown,
body.novavia-booking .el-picker-panel,
body.novavia-booking .el-cascader__dropdown {
    font-family: "Inter", sans-serif !important;
    border-radius: 14px !important;
    border: 1px solid #E8E2D5 !important;
    box-shadow: 0 16px 40px rgba(14, 58, 58, 0.14) !important;
}

body.novavia-booking .el-select-dropdown__item,
body.novavia-booking .el-select-group__title,
body.novavia-booking .el-picker-panel__content,
body.novavia-booking .el-date-table td,
body.novavia-booking .el-time-spinner__item {
    font-family: "Inter", sans-serif !important;
    font-size: 15px !important;
    color: #334155 !important;
}

body.novavia-booking .el-select-dropdown__item.selected,
body.novavia-booking .el-select-dropdown__item:hover {
    color: #0E7C7B !important;
    background: rgba(14, 124, 123, 0.07) !important;
    font-weight: 600;
}

body.novavia-booking .el-select-group__title {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #8A94A6 !important;
}

body.novavia-booking .el-popper.is-light {
    font-family: "Inter", sans-serif !important;
}

/* Scroll-down notice + polished receipt */
.nv-receipt-wrapper {
    margin-top: 24px;
}
.nv-receipt-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0E7C7B 0%, #0A5E5D 100%);
    color: #fff;
    font-family: "Sora", sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 14px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(14, 124, 123, 0.25);
    animation: nv-notice-pulse 2s ease-in-out infinite;
}
.nv-receipt-notice-icon {
    font-size: 20px;
    animation: nv-bounce-down 1.5s ease-in-out infinite;
}
@keyframes nv-notice-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(14, 124, 123, 0.25); }
    50% { box-shadow: 0 8px 32px rgba(14, 124, 123, 0.4); }
}
@keyframes nv-bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}
.nv-receipt {
    position: relative;
    overflow: hidden;
}
.nv-receipt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #0E7C7B, #C9A96A, #0E7C7B);
}
.nv-receipt-head {
    padding-top: 8px;
}

/* Floating receipt download button */
.nv-receipt-fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 9999;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.nv-receipt-fab.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.nv-fab-main {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0E7C7B, #0A5E5D);
    border: none;
    border-radius: 999px;
    padding: 14px 24px 14px 18px;
    box-shadow: 0 8px 24px rgba(14, 124, 123, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: "Sora", sans-serif;
}
.nv-fab-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(14, 124, 123, 0.5);
}
.nv-fab-icon {
    font-size: 24px;
}
.nv-fab-text {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}
.nv-fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.nv-receipt-fab.open .nv-fab-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.nv-fab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #0E7C7B;
    border-radius: 999px;
    padding: 10px 18px;
    font-family: "Sora", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0E7C7B;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    white-space: nowrap;
    transition: background 0.2s;
}
.nv-fab-item:hover {
    background: #0E7C7B;
    color: #fff;
}

/* Fix notice overlap — clear separation */
.nv-receipt-wrapper {
    margin-top: 24px;
    position: relative;
    z-index: 1;
}
.nv-receipt-notice {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}
.nv-receipt {
    position: relative;
    z-index: 1;
}

/* Button icons */
.nv-btn-icon {
    margin-right: 8px;
}
