/* ══════════════════════════════════════════
   REGISTRATION MODAL
══════════════════════════════════════════ */

/* Overlay */
#registration-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;        /* vertically centered on all breakpoints */
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    overflow-y: auto;
}
#registration-modal-overlay.active {
    display: flex;
}

/* ── DESKTOP modal: 1280×542px ── */
#registration-modal {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    width: 1280px;
    height: 542px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

/* ── Close button: desktop → top-left of modal ── */
.modal-close-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    color: #06174C;
}

/* ── Left pane: form ── */
.modal-form-pane {
    flex: 1;
    min-width: 0;
    padding: 56px 48px 56px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-title {
    font-family: "Rakuten Sans", sans-serif;
    font-weight: 700;
    font-size: 50px;
    line-height: 100%;
    letter-spacing: 0;
    color: #06174C;
    margin: 0 0 32px 0;
}

.modal-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-email-input {
    width: 390px;
    height: 60px;
    border: 0.5px solid #8691AE;
    border-radius: 14px;
    padding: 0 20px;
    font-family: "Rakuten Sans", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 21px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #FF3657;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    box-sizing: border-box;
}
.modal-email-input::placeholder {
    color: #06174C;
}
.modal-email-input:focus {
    border-color: #06174C;
}
.modal-email-input.input-error {
    border-color: #FF3657;
}

.modal-arrow-btn {
    width: 60px;
    height: 60px;
    background: #06174C;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.modal-arrow-btn:hover {
    background: #0a2570;

}
    .modal-arrow-btn:disabled {
 background-color: #CACCD7;
}
/* ── Error / info text — always visible ── */
.modal-error-text {
    margin-top: 12px;
    font-family: "Rakuten Sans", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 125%;
    color: #FF3657;
    display: block;
}
.modal-error-text a {
    font-weight: 700;
    color: #FF3657;
    text-decoration: underline;
}

/* ── Right pane: image ── */
.modal-image-pane {
    width: 500px;
    flex-shrink: 0;
    overflow: hidden;
}
.modal-image-pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/* Desktop: show web image only */
.modal-img-mobile { display: none; }
.modal-img-web    { display: block; }
/* Wrapper: static on desktop so close btn bubbles to modal level */
.modal-img-wrap   { position: static; }


/* ══════════════════════════════════════════
   IPAD MINI (768px – 819px)
══════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 819px) {

    #registration-modal {
        flex-direction: column;
        width: 600px;
        height: auto;
        max-width: calc(100vw - 32px);
        max-height: none;
        overflow: visible;
    }

    .modal-image-pane {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        order: 1;
        overflow: visible;
        border-radius: 20px 20px 0 0;
        position: relative;
    }
    .modal-img-wrap {
        position: static;
        display: block;
        line-height: 0;
        border-radius: 20px 20px 0 0;
        overflow: hidden;
    }
    .modal-img-web    { display: none !important; }
    .modal-img-mobile { display: block !important; }

    .modal-image-pane img {
        width: 100%;
        height: auto;
        object-fit: unset;
    }

    .modal-form-pane {
        order: 2;
        flex-shrink: 0;
        padding: 32px 40px 36px 40px;
        background: #ffffff;
        border-radius: 0 0 20px 20px;
    }

    .modal-title {
        font-size: 36px;
        margin-bottom: 24px;
    }

    .modal-email-input {
        width: 340px;
        height: 54px;
        font-size: 18px;
    }

    .modal-arrow-btn {
        width: 54px;
        height: 54px;
    }

    /* ── IPAD MINI close button — adjust top / right as needed ── */
    .modal-close-btn {
        position: absolute;
        top: 66px;      /* ← iPad Mini top offset */
        right: 66px;    /* ← iPad Mini right offset */
        left: unset;
        width: 28px;
        height: 28px;
        background: transparent;
        border: none;
        z-index: 20;
        color: #FFFFFF !important;
    }

    .modal-error-text {
        font-size: 14px;
        margin-top: 10px;
        line-height: 125%;
    }
    .modal-error-text a {
        font-size: 14px;
    }
}


/* ══════════════════════════════════════════
   IPAD AIR / PRO (820px – 1023px)
══════════════════════════════════════════ */
@media (min-width: 820px) and (max-width: 1023px) {

    #registration-modal {
        flex-direction: column;
        width: 600px;
        height: auto;
        max-width: calc(100vw - 32px);
        max-height: none;
        overflow: visible;
    }

    .modal-image-pane {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        order: 1;
        overflow: visible;
        border-radius: 20px 20px 0 0;
        position: relative;
    }
    .modal-img-wrap {
        position: static;
        display: block;
        line-height: 0;
        border-radius: 20px 20px 0 0;
        overflow: hidden;
    }
    .modal-img-web    { display: none !important; }
    .modal-img-mobile { display: block !important; }

    .modal-image-pane img {
        width: 100%;
        height: auto;
        object-fit: unset;
    }

    .modal-form-pane {
        order: 2;
        flex-shrink: 0;
        padding: 32px 40px 36px 40px;
        background: #ffffff;
        border-radius: 0 0 20px 20px;
    }

    .modal-title {
        font-size: 36px;
        margin-bottom: 24px;
    }

    .modal-email-input {
        width: 340px;
        height: 54px;
        font-size: 18px;
    }

    .modal-arrow-btn {
        width: 54px;
        height: 54px;
    }

    /* ── IPAD AIR close button — adjust top / right as needed ── */
    .modal-close-btn {
        position: absolute;
        top: 66px;      /* ← iPad Air top offset */
        right: 66px;    /* ← iPad Air right offset */
        left: unset;
        width: 28px;
        height: 28px;
        background: transparent;
        border: none;
        z-index: 20;
        color: #FFFFFF !important;
    }

    .modal-error-text {
        font-size: 14px;
        margin-top: 10px;
        line-height: 125%;
    }
    .modal-error-text a {
        font-size: 14px;
    }
}


/* ══════════════════════════════════════════
   MOBILE (≤767px)
══════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Overlay: anchor to top so popup is never cut on small screens */
    #registration-modal-overlay {
        align-items: flex-start;
        padding: 80px 12px 20px 12px;
    }

    /* Modal container */
    #registration-modal {
        flex-direction: column;
        width: calc(100vw - 24px);
        max-width: 480px;
        height: 585px;
        max-height: none;
        border-radius: 28px;
        /* Must NOT be overflow:hidden — that clips the close button */
        overflow: visible;

    }

    /* ── Image pane: position:relative — close btn anchor ── */
    .modal-image-pane {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        order: 1;
        /* position:relative makes this the anchor for the close btn */
        position: relative;
        /* overflow:visible so close btn is NOT clipped */
        overflow: visible;
        border-radius: 28px 28px 0 0;
    }

    /* Inner wrapper: overflow:hidden clips the image corners only */
    .modal-img-wrap {
        position: static;           /* NOT relative — pane is the anchor */
        display: block;
        line-height: 0;
        border-radius: 28px 28px 0 0;
        overflow: hidden;           /* clips image to rounded corners */
    }

    .modal-image-pane img {
        width: 100%;
        height: auto;
        object-fit: unset;
    }

    .modal-img-web    { display: none !important; }
    .modal-img-mobile { display: block !important; }

    /* ── Form pane ── */
    .modal-form-pane {
        order: 2;
        flex-shrink: 0;
        padding: 24px 24px 28px 24px;
        background: #ffffff;
        border-radius: 0 0 28px 28px;
    }

    .modal-title {
        font-size: 28px;
        margin-bottom: 20px;
        max-width: 255px;
    }

    .modal-input-row {
        gap: 8px;
    }

    .modal-email-input {
        width: 240px;
        height: 45px;
        font-size: 16px;
        border-radius: 14px;
    }

    .modal-arrow-btn {
        width: 45px;
        height: 45px;
        border-radius: 14px;
    }
    .modal-arrow-btn svg {
        width: 16px;
        height: auto;
    }

    .modal-error-text {
        margin-top: 8px;
        font-size: 12px;
        line-height: 100%;
        color: #FF3657;
        max-width: 243px;
        width: 243px;
    }
    .modal-error-text a {
        font-weight: 700;
        font-size: 12px;
        color: #FF3657;
        text-decoration: underline;
    }

    /* ── Close button: anchored to .modal-image-pane (position:relative) ──
       Sits OUTSIDE .modal-img-wrap (which is overflow:hidden) so it is
       never clipped by overflow:hidden on the wrapper.
       On mobile/tablet: anchored to .modal-image-pane (position:relative).
       On desktop: .modal-image-pane is static → btn bubbles to #registration-modal → top-left. */
    .modal-close-btn {
        position: absolute;
        top: 48px;
        right: 48px;
        left: unset;
        width: 28px;
        height: 28px;
        background: transparent;
        border: none;
        z-index: 20;
        color: #FFFFFF !important;
    }
}
