/* ================================================
   EUROAION REDESIGN — Modal UI (standalone)
   Prefixed with .ea-modal / .ea-modal-overlay so it
   never collides with Bootstrap's own .modal styles
   on pages that still ship the legacy layout.
   ================================================ */

/* === OVERLAY === */
.ea-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ea-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === MODAL CONTAINER === */
.ea-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 440px;
    max-width: calc(100vw - 32px);
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(165deg, rgba(16, 18, 24, 0.98), rgba(10, 12, 16, 0.99));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    padding: 40px 36px;
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    color: var(--text-primary, #ffffff);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.ea-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.ea-modal *,
.ea-modal *::before,
.ea-modal *::after {
    box-sizing: border-box;
}

.ea-modal--wide {
    width: 640px;
}

/* Never underline links inside modals — hover is expressed via color change only */
.ea-modal a,
.ea-modal a:hover,
.ea-modal a:focus,
.ea-modal a:active {
    text-decoration: none;
}

/* === CLOSE BUTTON === */
.ea-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-muted, #666666);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

.ea-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #ffffff);
    border-color: rgba(255, 255, 255, 0.2);
}

/* === TITLE & TEXT === */
.ea-modal__title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0 0 20px;
    text-align: center;
    line-height: 1.2;
}

.ea-modal__subtitle {
    font-size: 15px;
    color: var(--text-secondary, #b0b0b0);
    text-align: center;
    margin: 0 0 12px;
    line-height: 1.6;
}

.ea-modal__note {
    font-size: 13px;
    color: var(--text-muted, #666666);
    line-height: 1.6;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm, 6px);
    border-left: 3px solid var(--border, rgba(255, 255, 255, 0.08));
}

.ea-modal__note--accent {
    border-left-color: var(--accent-dim, #2d8a5a);
    color: var(--accent-light, #4cc985);
    background: var(--accent-glow, rgba(57, 171, 111, 0.15));
}

/* === FORM === */
.ea-modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.ea-modal .form-group {
    position: relative;
    margin: 0;
}

.ea-modal .form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 6px);
    color: var(--text-primary, #ffffff);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    box-sizing: border-box;
}

.ea-modal .form-input:focus {
    border-color: var(--accent-dim, #2d8a5a);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(57, 171, 111, 0.1);
}

.ea-modal .form-input::placeholder {
    color: var(--text-muted, #666666);
    opacity: 1;
}

.ea-modal .form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ea-modal .form-group--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #39ab6f);
    flex-shrink: 0;
    margin: 2px 0 0;
    cursor: pointer;
}

.ea-modal .form-group--checkbox label {
    font-size: 13px;
    color: var(--text-secondary, #b0b0b0);
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}

.ea-modal .form-group--checkbox label a {
    color: var(--accent-light, #4cc985);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ea-modal .form-group--checkbox label a:hover {
    color: var(--accent, #39ab6f);
    text-decoration: none;
}

.ea-modal .form-group--captcha {
    display: flex;
    justify-content: center;
}

/* === SUBMIT BUTTON === */
.ea-modal__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
    padding: 16px 36px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm, 6px);
    border: none;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--accent, #39ab6f), var(--accent-dim, #2d8a5a));
    color: #ffffff;
    box-shadow: 0 2px 16px rgba(57, 171, 111, 0.3);
    -webkit-appearance: none;
    appearance: none;
    text-transform: none;
    line-height: 1.2;
}

.ea-modal__submit:hover {
    background: linear-gradient(135deg, var(--accent-light, #4cc985), var(--accent, #39ab6f));
    box-shadow: 0 4px 24px rgba(57, 171, 111, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

.ea-modal__submit:focus {
    outline: none;
}

.ea-modal__submit:active {
    transform: translateY(0);
}

/* === LINKS (e.g. "Forgot password") === */
.ea-modal__links {
    text-align: center;
    margin-top: 4px;
}

.ea-modal__links a {
    font-size: 13px;
    color: var(--text-muted, #666666);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ea-modal__links a:hover {
    color: var(--accent-light, #4cc985);
}

/* === DOWNLOAD MODAL SECTIONS === */
.ea-modal .download-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.ea-modal .download-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ea-modal .download-section__title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-light, #4cc985);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ea-modal .download-section__title i {
    font-size: 14px;
}

.ea-modal .download-section__text {
    font-size: 14px;
    color: var(--text-secondary, #b0b0b0);
    line-height: 1.6;
    margin: 0 0 10px;
}

.ea-modal .download-steps {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.ea-modal .download-steps li {
    counter-increment: step;
    font-size: 14px;
    color: var(--text-secondary, #b0b0b0);
    line-height: 1.6;
    padding-left: 32px;
    position: relative;
    list-style: none;
}

.ea-modal .download-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-glow, rgba(57, 171, 111, 0.15));
    border: 1px solid var(--accent-dim, #2d8a5a);
    color: var(--accent, #39ab6f);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ea-modal .download-steps li a,
.ea-modal .download-section a {
    color: var(--accent-light, #4cc985);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ea-modal .download-steps li a:hover,
.ea-modal .download-section a:hover {
    color: var(--accent, #39ab6f);
    text-decoration: none;
}

.ea-modal .download-deps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ea-modal .download-deps li {
    font-size: 14px;
    color: var(--text-secondary, #b0b0b0);
    list-style: none;
}

.ea-modal .download-deps li::before {
    content: '•';
    color: var(--accent, #39ab6f);
    margin-right: 8px;
}

.ea-modal .download-forum-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 18px;
    background: rgba(57, 171, 111, 0.06);
    border: 1px solid rgba(57, 171, 111, 0.25);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.ea-modal .download-forum-link:hover {
    background: rgba(57, 171, 111, 0.12);
    border-color: rgba(57, 171, 111, 0.5);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.ea-modal .download-forum-link .fa-circle-question {
    font-size: 16px;
    flex-shrink: 0;
}

.ea-modal .download-forum-link .fa-arrow-up-right-from-square {
    font-size: 11px;
    margin-left: auto;
    opacity: 0.7;
}

/* === SCROLLBAR === */
.ea-modal::-webkit-scrollbar {
    width: 6px;
}

.ea-modal::-webkit-scrollbar-track {
    background: transparent;
}

.ea-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ea-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .ea-modal {
        padding: 32px 20px;
    }

    .ea-modal--wide {
        width: calc(100vw - 32px);
    }

    .ea-modal__title {
        font-size: 20px;
    }
}

/* Lock body scroll while modal is open */
body.ea-modal-open {
    overflow: hidden;
}

/* === STATIC VARIANT (used on standalone pages, e.g. /Home/Register, /Home/Download) ===
   Reuses the modal look but lays out inline within page flow, with wider canvas
   and more breathing room than the popup variant. */
.ea-modal--static {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    width: 100%;
    max-width: 640px;
    margin: 180px auto 80px;
    padding: 56px 56px;
    max-height: none;
    overflow-y: visible;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

/* Wide static variant (Download page) — narrower canvas with 1+2 grid layout */
.ea-modal--wide.ea-modal--static {
    max-width: 880px;
    padding: 56px 64px;
}

/* Eye-catching page header inside a static card */
.ea-page-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.ea-page-header__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow, rgba(57, 171, 111, 0.15));
    border: 1px solid var(--accent-dim, #2d8a5a);
    color: var(--accent-light, #4cc985);
    font-size: 26px;
}

.ea-page-header .ea-modal__title {
    margin-bottom: 10px;
}

.ea-page-header__lead {
    font-size: 15px;
    color: var(--text-secondary, #b0b0b0);
    line-height: 1.6;
    margin: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* Download page: Launcher spans full width, Torrent + Direct Download sit side-by-side below */
.ea-modal--wide.ea-modal--static .download-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 32px;
}

.ea-modal--wide.ea-modal--static .download-grid > .download-section:first-child {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .ea-modal--wide.ea-modal--static .download-grid {
        grid-template-columns: 1fr;
    }
}

.ea-modal--wide.ea-modal--static .download-grid .download-section {
    margin: 0;
    padding: 24px 22px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 6px);
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 720px) {
    .ea-modal--static {
        padding: 32px 22px;
        margin: 24px auto 56px;
    }

    .ea-modal--wide.ea-modal--static {
        padding: 32px 22px;
    }

    .ea-page-header {
        margin-bottom: 22px;
        padding-bottom: 22px;
    }

    .ea-page-header__icon {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

/* === Field validation hints (live form validation) === */
.ea-field-hint {
    display: block;
    min-height: 1em;
    margin-top: 4px;
    font-size: 0.85em;
    line-height: 1.3;
    color: #c94a4a;
}
.ea-field-hint:empty { display: none; }

.ea-modal__form .form-input.is-invalid {
    border-color: #c94a4a;
    box-shadow: 0 0 0 1px rgba(201, 74, 74, 0.35);
}
.ea-modal__form .form-input.is-valid {
    border-color: #3a9d5d;
}

.ea-pwd-checks {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    font-size: 0.85em;
    line-height: 1.5;
}
.ea-pwd-checks li {
    position: relative;
    padding-left: 1.4em;
    color: #888;
    transition: color 0.15s ease;
}
.ea-pwd-checks li::before {
    content: "✕";
    position: absolute;
    left: 0;
    top: 0;
    color: #c94a4a;
    font-weight: 700;
}
.ea-pwd-checks li.is-ok { color: #3a9d5d; }
.ea-pwd-checks li.is-ok::before {
    content: "✓";
    color: #3a9d5d;
}

.ea-modal__submit[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

