/* --- GLOBAL MODAL --- */

body.modal-open {
    overflow: hidden;
}

.mep-modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}
.mep-modal.is-active {
    display: flex;
}

.mep-modal-background {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.mep-modal-container {
    position: relative;
    z-index: 10;
    width: 100%;
    margin: 1.5rem;
    box-sizing: border-box;
    max-width: 38rem;
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
}

.mep-modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.mep-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 0.25rem 0;
}

.mep-modal-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-slate-900);
    margin: 0 0 0.25rem 0;
}

.mep-modal-description {
    color: var(--color-slate-500);
    font-size: 0.95rem;
    line-height: 1.625;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
}

.mep-modal-text {
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
}

.mep-modal-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-top: 1px solid var(--color-slate-100);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.mep-modal-close-icon {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--color-slate-400);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
    z-index: 20;
}

.mep-modal-close-icon:hover {
    color: var(--color-slate-900);
}

.mep-modal-action-btn {
    width: 100%;
    padding: 0.75rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    margin-top: 1.5rem;
}

/* --- LANGUAGE MODAL --- */

/* Constrain language modal width so it's not unnecessarily wide */
.mep-lang-modal-content {
    max-width: 24rem;
    padding: 1.5rem;
}

/* Header Trigger Button */
.lang-modal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.lang-modal-trigger:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.chevron-icon {
    width: 0.75rem;
    height: 0.75rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.lang-modal-trigger:hover .chevron-icon {
    transform: translateY(1px);
    color: #64748b;
}

/* SVG Flag Wrappers */
.flag-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.flag-trigger {
    width: 1.125rem;
    height: 1.125rem;
}

.flag-option {
    width: 2.25rem;
    height: 2.25rem;
}

/* Language Selection List */
.lang-modal-options {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.lang-option-btn {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.lang-option-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.lang-option-btn.active {
    border-color: #059669;
    background-color: #ecfdf5;
}

.lang-text-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.lang-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}

.lang-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.check-mark {
    color: #059669;
    font-size: 1.125rem;
    font-weight: 900;
}

/* --- LEGAL MODAL --- */

.legal-modal-meta {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.legal-modal-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.legal-modal-heading {
    color: #111827;
    font-weight: 700;
    font-size: 0.95rem;
}

.legal-modal-text-block {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.legal-modal-email {
    color: #059669;
    font-weight: 700;
    text-decoration: none;
    margin-top: 0.25rem;
    display: inline-block;
    transition: color 0.15s ease;
}

.legal-modal-email:hover {
    color: #047857;
    text-decoration: underline;
}

/* --- TRIAL MODAL --- */

.trial-benefits-box {
    background-color: #ecfdf5;
    border: 1px solid #d1fae5;
    padding: 1rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.trial-benefits-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #065f46;
}

.trial-benefits-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.95rem;
    color: #064e3b;
    line-height: 1.5;
}

.trial-form-group {
    margin-bottom: 1rem;
}

.trial-form-group:last-of-type {
    margin-bottom: 1.25rem;
}

.trial-form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.trial-form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.trial-form-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.trial-error-msg {
    color: #b91c1c;
    background-color: #fef2f2;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.trial-success-title {
    color: #059669;
}

/* --- Mobile --- */

@media (max-width: 30em) {
    .lang-modal-card {
        max-width: 100%;
        margin: 0 0.5rem;
    }
    
    .lang-modal-trigger .current-lang-text {
        font-size: 0.75rem;
    }
}