/*
 * Floating "Register Your Request" button + modal
 * Uses brand tokens from masterpiece-global.css (--brand-gold, --brand-dark)
 */

/* ───────── FAB ───────── */
.fr-fab {
    position: fixed;
    bottom: 24px;
    /* RTL: left side */
    left: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 14px 16px;
    background: linear-gradient(135deg, var(--brand-gold), #e8c07e);
    color: var(--brand-dark, #001515);
    border: none;
    border-radius: 999px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        0 12px 28px rgba(212, 175, 55, 0.45),
        0 4px 10px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity .4s ease, transform .4s ease, visibility .4s, box-shadow .3s, background .3s;
}
.fr-fab.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.fr-fab:hover {
    background: linear-gradient(135deg, #e8c07e, var(--brand-gold));
    box-shadow:
        0 18px 34px rgba(212, 175, 55, 0.55),
        0 6px 14px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}
.fr-fab-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0, 21, 21, 0.12);
    border-radius: 50%;
    flex-shrink: 0;
}
.fr-fab-icon svg { width: 18px; height: 18px; }
.fr-fab-label { white-space: nowrap; letter-spacing: 0.2px; }

@media (max-width: 600px) {
    .fr-fab {
        bottom: 18px;
        left: 18px;
        padding: 12px 16px 12px 14px;
        font-size: 0.85rem;
        gap: 8px;
    }
    .fr-fab-icon { width: 28px; height: 28px; }
    .fr-fab-icon svg { width: 16px; height: 16px; }
}


/* ───────── Modal ───────── */
.fr-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s;
}
.fr-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.fr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 16, 16, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}
body.fr-modal-open { overflow: hidden; cursor: auto !important; }
/* Restore native cursor inside the modal — the site's custom cursor (z-index 9999/10000)
   is hidden behind the modal (z-index 99999), so we disable it while modal is open. */
body.fr-modal-open .mouse-dot,
body.fr-modal-open .mouse-follower { display: none !important; }
.fr-modal, .fr-modal * { cursor: auto; }
.fr-modal a, .fr-modal button, .fr-modal [role="button"], .fr-modal-overlay, .fr-modal-close, .fr-submit { cursor: pointer; }
.fr-modal input, .fr-modal textarea, .fr-modal select { cursor: text; }
.fr-modal select { cursor: pointer; }

.fr-modal-card {
    position: relative;
    width: 100%;
    max-width: 580px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(20px) scale(0.97);
    transition: transform .35s cubic-bezier(.18,.89,.32,1.28);
    direction: rtl;
}
.fr-modal.is-open .fr-modal-card { transform: translateY(0) scale(1); }

.fr-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px; height: 36px;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background .2s, color .2s, border-color .2s;
    z-index: 2;
}
.fr-modal-close:hover { background: var(--brand-dark, #001515); color: #fff; border-color: var(--brand-dark, #001515); }
.fr-modal-close svg { width: 16px; height: 16px; }

.fr-modal-header {
    padding: 32px 28px 18px;
    text-align: right;
    border-bottom: 1px solid #f3f4f6;
}
.fr-modal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8f6ee;
    color: #7a6017;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}
.fr-modal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-gold); }
.fr-modal-title {
    font-family: 'Tajawal', sans-serif;
    font-size: clamp(1.35rem, 4vw, 1.7rem);
    font-weight: 900;
    color: var(--brand-dark, #001515);
    margin: 0 0 6px;
}
.fr-modal-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
}

.fr-modal-body {
    padding: 22px 28px 28px;
}

/* Form */
.fr-form { display: flex; flex-direction: column; gap: 16px; }
.fr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 520px) { .fr-grid { grid-template-columns: 1fr; } }
.fr-field { display: flex; flex-direction: column; }
.fr-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}
.fr-req { color: #ef4444; }
.fr-field input,
.fr-field select,
.fr-field textarea {
    font-family: 'Tajawal', sans-serif;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    font-size: 0.9rem;
    color: #1f2937;
    transition: border-color .2s, background .2s, box-shadow .2s;
    outline: none;
}
.fr-field textarea { resize: vertical; min-height: 96px; }
.fr-field input:focus,
.fr-field select:focus,
.fr-field textarea:focus {
    border-color: var(--brand-gold);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.fr-submit {
    margin-top: 4px;
    padding: 14px 24px;
    background: var(--brand-gold);
    color: var(--brand-dark, #001515);
    border: 1px solid var(--brand-gold);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .25s, color .25s, transform .2s, box-shadow .25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.fr-submit:hover:not(:disabled) {
    background: var(--brand-dark, #001515);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}
.fr-submit:disabled { opacity: 0.7; cursor: wait; }

.fr-submit-spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: fr-spin 0.7s linear infinite;
}
.fr-submit.is-loading .fr-submit-spinner { display: inline-block; }
.fr-submit.is-loading .fr-submit-label { opacity: 0.7; }
@keyframes fr-spin { to { transform: rotate(360deg); } }

/* Alerts */
.fr-alert {
    padding: 16px 18px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.fr-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    text-align: center;
}
.fr-alert-success .fr-alert-icon {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fr-alert-success h4 { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; }
.fr-alert-success p { margin: 0; color: #15803d; }
.fr-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.fr-alert-error ul { margin: 0; padding-right: 18px; list-style: disc; }
.fr-alert-error li { margin: 2px 0; }
