/* =========================================================
   components.css — ekphra global UI components
   Loaded via navbar.php on every page
   Add shared UI patterns here (modals, toasts, tooltips...)
========================================================= */

/* =========================================================
   MODAL SYSTEM
========================================================= */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}
.overlay.active { display: block; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
}
.modal.active { display: flex; }

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 44px 40px 36px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.22);
    position: relative;
    width: min(92vw, 520px);
    max-height: 88vh;
    overflow-y: auto;
}

.modal-large {
    width: min(94vw, 900px);
}
.modal-large .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #bbb;
    padding: 4px;
    line-height: 1;
}
.modal-close:hover { color: var(--black); }

.modal-eyebrow {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal);
    text-align: center;
    margin-bottom: 10px;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--gray-dark);
    text-align: center;
    margin-bottom: 0;
    line-height: 1.2;
}
.modal-title em {
    font-style: italic;
    color: var(--teal);
}

.modal-divider {
    border: none;
    border-top: 0.5px solid var(--border);
    margin: 20px 0 24px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 6px;
}

.modal-input {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--black);
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
    display: block;
}
.modal-input:focus { border-bottom-color: var(--teal); }
.modal-input::placeholder { color: #ccc; font-size: 15px; }

.modal-textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--black);
    background: transparent;
    outline: none;
    height: 150px;
    resize: vertical;
    transition: border-color 0.2s;
}
.modal-textarea:focus { border-bottom-color: var(--teal); }

.modal-eye-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 0;
    line-height: 1;
}
.modal-eye-btn:hover { color: #888; }

.modal-forgot {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--teal);
    cursor: pointer;
    margin-top: -10px;
    margin-bottom: 22px;
    text-decoration: none;
}
.modal-forgot:hover { color: var(--teal-dark); }

.modal-resend {
    font-size: 11px;
    color: var(--teal);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-modal-primary {
    width: 100%;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 14px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 4px;
    transition: background 0.18s;
    display: block;
}
.btn-modal-primary:hover { background: var(--teal-dark); }

.btn-modal-teal {
    width: 100%;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 13px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s;
    display: block;
}
.btn-modal-teal:hover { background: var(--teal-dark); }

.btn-modal-outline {
    width: 100%;
    background: transparent;
    color: var(--gray-mid);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 13px;
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
    display: block;
}
.btn-modal-outline:hover { border-color: #aaa; color: var(--gray-dark); }

.modal-section {
    border: 0.5px solid var(--border);
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 12px;
}
.modal-section--accent {
    border-left: 2px solid var(--teal);
}
.modal-section-tag {
    display: block;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 6px;
}
.modal-section:not(.modal-section--accent) .modal-section-tag {
    color: #bbb;
}
.modal-section-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 400;
    color: var(--gray-dark);
    margin-bottom: 6px;
}
.modal-section-desc {
    font-size: 13px;
    color: var(--gray-mid);
    line-height: 1.7;
    margin-bottom: 14px;
}
.modal-section-desc strong { color: var(--gray-dark); }

.modal-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.modal-check-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    cursor: pointer;
}
.modal-check-row label {
    font-size: 11px;
    color: #aaa;
    line-height: 1.6;
    cursor: pointer;
}
.modal-check-row label a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.modal-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #aaa;
}
.modal-switch a {
    color: var(--gray-dark);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.error-msg {
    background: #fff0f0;
    color: #c0392b;
    padding: 10px 14px;
    border-left: 2px solid #c0392b;
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    margin-bottom: 16px;
    display: none;
}
.success-msg {
    background: var(--teal-light);
    color: var(--teal-dark);
    padding: 10px 14px;
    border-left: 2px solid var(--teal);
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    margin-bottom: 16px;
    display: none;
}
/* =========================================================
   MODAL SYSTEM — Mobile
========================================================= */
@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
        padding: 0;
        backdrop-filter: none;
    }
    .modal-box {
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 32px 24px 28px;
        max-height: 92vh;
    }
    .modal-large {
        width: 100vw;
        height: 100vh;
    }
    .modal-large .modal-box {
        height: 100%;
        border-radius: 0;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
}