.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999999;
}

.popup-overlay.is-hidden {
    display: none;
}

body.popup-open {
    overflow: hidden;
}

.pop-up {
    margin: 64px 50px;
    padding: 64px 50px;
    background-color: #fff;
    z-index: 999;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.popup-header>h2 {
    font-family: Urbanist, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.popup-content {
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
}

.popup-content>p {
    font-family: Plus Jakarta Sans, sans-serif;
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.popup-footer {
    padding: 20px 0;
    border-top: 1px solid #ddd;
}

.checkbox-label {
    font-family: Plus Jakarta Sans, sans-serif;
    font-size: 0.8rem;
}

.checkbox-error {
    font-family: Plus Jakarta Sans, sans-serif;
    color: #d93025; /* red for error */
    font-size: 0.75rem;
    margin-top: 4px;
    display: none; /* hidden by default */
}

.form-footer button {
    background: #104b88;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.form-footer {
    padding: 20px 0;
    display: flex;
    gap: 16px;
}

#goBack {
    background: #eeeeee;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: Plus Jakarta Sans, sans-serif;
    font-size: 0.8rem;
    text-decoration: none;
    color: #000;
    transition: background 0.3s;
}

/* Fade-out animation */
.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

.popup-overlay--notice {
    background: rgba(0, 0, 0, 0.72);
}

.pop-up--notice {
    width: min(1000px, calc(100vw - 48px));
    max-height: min(86vh, 760px);
    gap: 0;
    border-radius: 0;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    padding: 30px 32px 22px;
}

.popup-notice-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.popup-notice-brand img {
    width: 48px;
    height: auto;
    display: block;
}

.popup-close-button {
    width: 24px;
    height: 24px;
    border: 0;
    background: #ddd4d0;
    color: #2e2e2e;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.popup-header--notice {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #161616;
}

.pop-up--notice .popup-header--notice > h2 {
    margin-bottom: 0;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 600;
    max-width: 900px;
}

.pop-up--notice .popup-content {
    overflow-y: auto;
    padding-right: 8px;
}


.popup-content--notice{
    border-bottom: 1px solid #161616;
}

.popup-content--notice > p,
.popup-notice-points p,
.popup-notice-points li {
    font-family: Plus Jakarta Sans, sans-serif;
    font-size: 1rem;
    line-height: 1.618;
    color: #111;
}

.popup-content--notice > p {
    margin-bottom: 20px;
}

.popup-content--notice a {
    color: #214dff;
    text-decoration: none;
}

.popup-content--notice a:hover {
    text-decoration: underline;
}

.popup-notice-points ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.popup-notice-points li {
    margin-bottom: 6px;
}

.popup-footer--notice {
    padding-top: 18px;
    padding-bottom: 0;
    margin-top: 14px;
    border-top: 1px solid #161616;
}

.form-footer--notice {
    padding-bottom: 0;
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.popup-primary-link {
    background: #104b88;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: Plus Jakarta Sans, sans-serif;
    text-decoration: none;
}

.popup-secondary-button {
    background: #ece7e3;
    color: #222;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: Plus Jakarta Sans, sans-serif;
}

.popup-close-button:hover {
    background: #2e2e2e;
    color: #fff;
}

.popup-primary-link:hover,
.popup-secondary-button:hover,
.form-footer--notice button:hover {
    background: #0c3a69;
    color: #fff;
}

@media screen and (max-width:430px) {
    .pop-up {
        margin: 20px;
        padding: 40px 20px;
        background-color: #fff;
        z-index: 999;
        max-height: 90vh;
        /* keeps popup within viewport */
        display: flex;
        flex-direction: column;
        /* needed for flex scrolling */
    }

    .pop-up--notice {
        width: calc(100vw - 24px);
        max-height: 88vh;
        padding: 20px 18px 18px;
    }

    .popup-notice-topbar {
        margin-bottom: 14px;
    }

    .popup-notice-brand img {
        width: 40px;
    }

    .pop-up--notice .popup-header--notice > h2 {
        font-size: 1.1rem;
    }

    .popup-content--notice > p,
    .popup-notice-points p,
    .popup-notice-points li {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .form-footer--notice {
        flex-direction: column;
    }

    .popup-primary-link,
    .popup-secondary-button,
    .form-footer--notice button,
    #goBack {
        width: 100%;
        text-align: center;
    }
}
