/* ═══════════════════════════════════════════════════════════════
   STYLES-MODAL.CSS  |  Modal windows, forms, floating button
   Global: loaded on every page that uses modals/consultation
   ═══════════════════════════════════════════════════════════════ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.modal {
    display: none !important;
    position: fixed !important;
    z-index: 10000 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0,0,0,0.7) !important;
    backdrop-filter: blur(5px) !important;
    overflow: auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
}

.modal-content {
    background: white !important;
    padding: 20px !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 380px !important;
    max-height: 90vh !important;
    position: relative !important;
    margin: auto !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    overflow-y: auto !important;
    transform: scale(0.9) !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

.modal.show .modal-content {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.modal-close {
    position: absolute !important;
    right: 10px !important;
    top: 10px !important;
    font-size: 20px !important;
    font-weight: bold !important;
    color: #999 !important;
    cursor: pointer !important;
    width: 25px !important;
    height: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,0.05) !important;
    z-index: 10 !important;
    transition: all 0.2s ease !important;
}

.modal-close:hover {
    color: #333 !important;
    background: rgba(0,0,0,0.1) !important;
}

.modal h3 {
    font-size: 1.2rem !important;
    margin-bottom: 5px !important;
    color: #2c3e50 !important;
    text-align: center !important;
    padding-right: 25px !important;
}

.modal p {
    text-align: center !important;
    color: #666 !important;
    margin-bottom: 15px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

/* ─── Form fields ──────────────────────────────────────────── */

.form-group {
    margin-bottom: 12px !important;
}

.form-group label {
    display: block !important;
    margin-bottom: 3px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    font-size: 12px !important;
}

.form-group input,
.form-group textarea {
    width: 100% !important;
    padding: 8px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    transition: border-color 0.3s ease !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
}

.form-group textarea {
    resize: vertical !important;
    min-height: 45px !important;
    max-height: 70px !important;
}

/* ─── Submit button ────────────────────────────────────────── */

.submit-btn {
    width: 100% !important;
    padding: 10px !important;
    background: linear-gradient(135deg, #2563eb, #1e3a8a) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-bottom: 10px !important;
    transition: transform 0.2s ease !important;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px) !important;
}

.submit-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ─── Floating consult button ──────────────────────────────── */

.rg-floating-consult-btn {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    padding: 10px 4px;
    border-radius: 999px 0 0 999px;
    border: none;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.rg-floating-consult-btn::before {
    content: '\1F4AC';
    font-size: 15px;
}

.rg-floating-consult-btn:hover {
    transform: translateY(-50%) translateX(-2px);
    box-shadow: 0 24px 50px rgba(37, 99, 235, 0.45);
}

.rg-floating-label {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .rg-floating-consult-btn {
        right: 12px;
        bottom: 16px;
        top: auto;
        transform: none;
        padding: 9px 13px;
        font-size: 12px;
    }
    .rg-floating-consult-btn:hover {
        transform: translateX(-1px);
    }
    .rg-floating-label {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ─── Success / error messages ─────────────────────────────── */

.success-message,
.error-message {
    display: none !important;
    text-align: center !important;
    font-size: 11px !important;
    padding: 6px !important;
    border-radius: 4px !important;
    margin-top: 5px !important;
}

.success-message {
    color: #27ae60 !important;
    background: rgba(39, 174, 96, 0.1) !important;
    border: 1px solid rgba(39, 174, 96, 0.2) !important;
}

.error-message {
    color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.1) !important;
    border: 1px solid rgba(231, 76, 60, 0.2) !important;
}

/* ─── Privacy notice ───────────────────────────────────────── */

.privacy-notice {
    margin-bottom: 12px !important;
}

.privacy-notice p {
    font-size: 10px !important;
    color: #666 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    text-align: center !important;
}

.privacy-notice a {
    color: #2563eb !important;
    text-decoration: none !important;
}

.privacy-notice a:hover {
    text-decoration: underline !important;
}

/* ─── Responsive modal ─────────────────────────────────────── */

@media (max-width: 768px) {
    .modal {
        padding: 10px !important;
    }
    .modal-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        max-height: 95vh !important;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 5px !important;
    }
    .modal-content {
        border-radius: 8px !important;
        padding: 15px !important;
    }
    .modal h3 {
        font-size: 1rem !important;
    }
    .form-group input,
    .form-group textarea {
        padding: 7px 8px !important;
        font-size: 14px !important;
    }
}
