/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #ffd0d0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Wrapper: 750px design base */
.wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background-image: url('/frontend/assets/imgs/bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: top center;
    background-color: #ffd0d0;
    height: 100vh;
    padding-bottom: 80px;
    overflow-y: auto;
}

/* ===== Top Download Bar ===== */
/* Figma: 726x113 (ratio 6.42:1), margin 12px, border-radius 21px */
.top-bar {
    margin: 2.13% 1.6% 0;
    background: linear-gradient(91.77deg, #991815 1.32%, #f6150f 58.25%, #ff2823 100.83%);
    border-radius: 21px;
    display: flex;
    align-items: center;
    gap: 2%;
    padding: 0 10px;
}

/* Logo: 82/726 = 11.3% of bar width */
.top-bar__logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
}

.top-bar__logo img {
    width: 100%;
    height: auto;
}

/* Text: fills middle space */
.top-bar__text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.top-bar__text img {
    width: 80%;
    height: auto;
}

/* Button: 141/726 = 19.4% of bar width */
.top-bar__btn {
    width: 141px;
    height: auto;
}

.top-bar__btn img {
    width: 100%;
    height: auto;
}

/* ===== Hero Section ===== */
/* Figma: hero_banner 629x317, centered in 750px = 83.9% */
.hero-section {
    text-align: center;
    padding: 0 8%;
}

.hero-section__bg {
    width: 100%;
    height: auto;
}

/* ===== CTA Buttons ===== */
/* Figma: buttons 420px wide in 750px, gap ~18px */
.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 19%;
}

.cta-btn {
    width: 100%;
    aspect-ratio: 410 / 65;
    background-image: url('/frontend/assets/imgs/action_btn.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.cta-btn__icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.cta-btn__text {
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
    font-size: 28px;
    line-height: 1;
    background: linear-gradient(180deg, #FFF9F0 0%, #FFEFD4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Promo Block (slot + ribbon + features as one unit) ===== */
.promo-block {
    position: relative;
}

/* Slot Image */
.promo-slot img {
    width: 100%;
    height: auto;
}

/* Ribbon + Features wrapper with red gradient bg */
.promo-bottom {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 0, 0, 0) 0%, rgba(255, 0, 0, 0) 35%, rgba(255, 0, 0, 0.3) 50%, rgba(170, 0, 0, 0.5) 100%);
    padding-bottom: 20px;
    margin-top: -118px;
    padding-top: 0;
}

/* Ribbon */
.promo-ribbon {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: -70px;
}

.promo-ribbon img {
    width: 85%;
    height: auto;
    margin: 42px auto;
}

/* Features 01/02/03 */
.promo-features {
    position: relative;
    margin: -132px 40px 0;
    padding: 68px 50px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-image: url('/frontend/assets/imgs/promo_feature_bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 16px;
}

.promo-features__item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.promo-features__badge {
    width: 46px;
    height: auto;
    flex-shrink: 0;
    z-index: 20;
}

.promo-features__bar {
    flex: 1;
    padding: 4px 40px;
    background: linear-gradient(90deg, #FFC787 0%, rgba(253, 255, 109, 0) 100%);
    border-radius: 22.106px;
    font-size: 16px;
    color: #480a00;
    font-weight: 600;
    margin-left: -33px;
    margin-top: 3px;
    z-index: 10;
}

.promo-features__bar strong {
    color: #FF0000;
    font-weight: 700;
}

.promo-ribbon__deco-1 {
    position: absolute;
    top: 35%;
    right: 3%;
    width: 70px;
    height: 70px;
    z-index: 10;
}

.promo-ribbon__deco-2 {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 70px;
    height: 70px;
    z-index: 10;
}

/* ===== Bottom Navigation ===== */
/* Figma: fixed at bottom, top border-radius only */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: #fce6e6;
    border-radius: 18px 18px 0 0;
    padding: 12px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 30;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.nav-item__icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nav-item__label {
    font-size: 18px;
    color: #480a00;
    font-weight: 400;
    white-space: nowrap;
}

/* ===== Register Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 100;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0;
    pointer-events: none;
    visibility: hidden;
    transition: background 0.3s, visibility 0.3s;
}

.modal-overlay > * {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.modal-overlay.active {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
    visibility: visible;
}

.modal-overlay.active > * {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.modal-container {
    position: relative;
    max-width: 450px;
    width: 90vw;
    border-radius: 16px;
    overflow: visible;
    background: #FFD0D0;
    background: linear-gradient(180deg,rgba(255, 208, 208, 1) 0%, rgba(255, 255, 255, 1) 100%);
    flex-shrink: 0;
}

.modal-title-img {
    flex-shrink: 0;
}

.modal-container-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url('/frontend/assets/imgs/modal-bg.png');
    background-size: contain;
    background-repeat: no-repeat;
    border-radius: 16px;
}

.modal-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    z-index: 0;
}

.modal-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 0;
}

.modal-logo-bg {
    width: 85%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.modal-logo-wrap {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
}

.modal-title-img {
    max-width: 450px;
    height: auto;
    margin: 0 auto;
}

.modal-logo-img {
    width: 40%;
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.modal-body {
    position: relative;
    z-index: 1;
    padding: 10px 24px 30px;
}

.modal-title {
    text-align: center;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #8C2B02;
    margin: 10px 0 25px;
}

.modal-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: linear-gradient(145.34deg, #EF5151 20.3%, #E2221C 85.48%);
    border: 1px solid #FFF6A7;
    box-shadow: 0px 4px 4px rgba(255, 128, 109, 0.35);
    border-radius: 42px;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #FFFFFF;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-link-btn:hover {
    opacity: 0.9;
}

.modal-close {
    position: relative;
    z-index: 101;
    margin-top: 20px;
    margin-bottom: 20px;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
}

.modal-close img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== Verify Modal Form (reuse old template styles) ===== */
.modal-body form dl {
    margin: 0 auto 0.15rem;
}

.modal-body form dl.clearfix {
    padding: 10px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.modal-body form dt {
    width: 5.5rem;
    flex-shrink: 0;
    color: #8C2B02;
    font-size: 0.9rem;
    margin: 0.4rem 0;
    font-weight: 700;
}

.modal-body form dd {
    width: calc(100% - 5.5rem);
    padding-bottom: 0.22rem;
    position: relative;
}

.modal-body form dd input.form-control {
    margin: 0;
    padding: 0 2.2rem 0 0.8rem;
    width: 100%;
    height: 2.8rem;
    display: block;
    color: #333;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 0.6rem;
    background: #fff;
    font-size: 0.9rem;
    outline: none;
}

.modal-body form dd input.form-control::placeholder {
    font-size: 0.85rem;
    color: #B1B1B1;
}

.modal-body form dd input.form-control:focus {
    border-color: #EF5151;
    background-color: #fff;
}

.modal-body form dd .input-group {
    position: relative;
}

.modal-body .exists-status {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 10px;
    z-index: 20;
    display: flex;
}

.modal-body .exists-status i {
    font-size: 22px;
    color: #09ff00;
    animation: zoomOutAnimation .5s;
}

.modal-body .exists-status.invalid i {
    color: #ff0000;
    animation: pulse 1s infinite;
}

.modal-body .exists-status.loading i {
    color: #a9a9a9;
    animation: loadingAnimation 3s infinite;
}

@keyframes loadingAnimation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes zoomOutAnimation {
    0% { transform: scale(0.5); }
    100% { transform: scale(1); }
}

.modal-body .input-group {
    display: flex;
    align-items: stretch;
}

.modal-body .input-group-prepend {
    display: flex;
}

.modal-body .input-group-text {
    display: flex;
    align-items: center;
    padding: 0 0.6rem;
    background-color: #EF5151;
    border: 1px solid #EF5151;
    color: #fff;
    border-radius: 0.6rem 0 0 0.6rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.modal-body .input-group .form-control {
    border-radius: 0 0.6rem 0.6rem 0;
    flex: 1;
    min-width: 0;
}

.modal-body .flag_vn {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    display: inline-block;
}

.modal-body .icoo {
    width: 28px;
    top: 9px;
    position: absolute;
    z-index: 10;
    left: 6px;
}

.modal-body .icoo + input.form-control {
    padding-left: 2rem;
}

.modal-body .error-message {
    color: #ff5353;
    font-size: 12px;
    margin-top: 0.15rem;
    text-align: left;
}

.modal-body dd.checking {
    position: relative;
}

.modal-body dd.checking input.form-control {
    width: 100%;
    padding-right: 9.5rem;
}

.modal-body .checking-img {
    display: inline-block;
    width: 9rem;
    position: absolute;
    right: 0;
    top: 0;
    height: 2.8rem;
    box-sizing: border-box;
    font-size: 1rem;
    text-align: center;
    line-height: 2.8rem;
}

.modal-body .checking-img img {
    width: 100%;
    height: 2.7rem;
    border-radius: 0 0.6rem 0.6rem 0;
    margin-top: 1px;
    cursor: pointer;
}

.modal-body .send-otp {
    cursor: pointer;
    width: 100%;
    height: 2.7rem;
    line-height: 2.7rem;
    display: inline-block;
    text-align: center;
    margin-top: 1px;
    background: linear-gradient(180deg, #FF2E0D 0%, #F01B1B 50%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0 0.6rem 0.6rem 0;
    text-decoration: none;
}

.modal-body .send-otp:hover {
    text-decoration: none;
    color: #fff;
}

.modal-body .send-otp.disabled {
    background: #999;
    cursor: not-allowed;
}

.modal-body .otp-note {
    width: 100%;
    max-width: 100%;
    margin: 0;
    font-weight: 300;
    font-style: italic;
    font-size: 0.8rem;
}

.modal-body .otp-note p {
    color: #666;
    margin-bottom: 0;
    font-size: 0.8rem;
}

.verify-submit {
    display: block;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 56px;
    background: linear-gradient(180deg, #EAC9C1 0%, #FF8466 25.89%, #FF321B 72.14%, #FF5941 118.47%);
    box-shadow: 0px 10px 18.7px rgba(255, 87, 87, 0.33), inset 0px 4px 28px rgba(255, 255, 255, 0.25);
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 22px;
    color: #FFFFFF;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 16px;
}

.verify-submit:hover {
    opacity: 0.9;
}

.verify-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.verify-steps {
    margin-top: 10px;
}

.verify-steps__header {
    text-align: center;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #FF1200;
    padding: 12px 0;
    background: linear-gradient(93.32deg, rgba(235, 126, 125, 0) 5.56%, rgba(255, 198, 198, 0.5) 45.32%, rgba(255, 198, 198, 0.5) 54.16%, rgba(235, 126, 125, 0) 93.92%);
    border-top: 1px solid rgba(235, 126, 125, 0.3);
    border-bottom: 1px solid rgba(235, 126, 125, 0.3);
}

.verify-steps__body {
    padding: 10px 0;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: #343434;
}

.verify-steps__body p {
    margin-bottom: 4px;
}

.verify-steps__warn {
    color: #E63200;
}

/* ===== Detail Modal ===== */
.detail-table {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.detail-table__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(145.34deg, #EF5151 20.3%, #E2221C 85.48%);
    border-radius: 12px 12px 0 0;
}

.detail-table__head span {
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #FFFFFF;
    text-align: center;
    flex: 1;
}

.detail-table__divider {
    width: 1px !important;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    flex: 0 0 1px !important;
}

.detail-table__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #FFFFFF;
    border-radius: 0 0 12px 12px;
}

.detail-table__body span {
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #000000;
    text-align: center;
    flex: 1;
}

.detail-notice {
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: #343434;
    margin-bottom: 14px;
}

.detail-rules {
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: #343434;
}

.detail-rules p {
    margin-bottom: 6px;
}

.detail-rules__link {
    color: #E69D00;
    font-weight: 500;
    text-decoration: underline;
}

/* ===== Responsive: mobile < 750px ===== */
@media (max-width: 749px) {
    .cta-btn__icon {
        width: 4.27vw;
        height: 4.27vw;
    }

    .cta-btn__text {
        font-size: 3.73vw;
    }

    .cta-btn__content {
        gap: 1.07vw;
    }

    .bottom-nav {
        border-radius: 2.4vw 2.4vw 0 0;
        padding: 1.6vw 0;
    }

    .nav-item {
        gap: 0.8vw;
    }

    .nav-item__icon {
        width: 5.33vw;
        height: 5.33vw;
    }

    .nav-item__label {
        font-size: 2.4vw;
    }

    .top-bar__text img {
        width: 100%;
    }

    .top-bar__logo {
        width: 62px;
        height: 62px;
    }

    .top-bar__btn {
        width: 108px;
    }

    .cta-buttons {
        gap: 20px;
        padding: 5px 19%;
    }

    .promo-bottom {
        margin-top: -92px;
    }

    .promo-features {
        margin: -108px 40px 0;
        padding: 50px 20px 7px;
    }

    .promo-features__item::first-child {
        margin-top: 10px;
    }

    .promo-features__badge {
        width: 32px;
    }

    .promo-features__bar {
        padding: 4px 0 0 30px;
        font-size: 14px;
        margin-top: 1px;
    }

    .modal-title-img {
        max-width: 325px;
        height: auto;
        margin: 0 auto;
    }

    .modal-body form dt {
        width: 4.8rem;
        font-size: 0.75rem;
    }

    .modal-body form dd input.form-control {
        height: 2.5rem;
        font-size: 0.8rem;
    }

    .modal-body dd.checking input.form-control {
        padding-right: 8rem;
    }

    .modal-body .checking-img {
        width: 7.5rem;
        height: 2.5rem;
        line-height: 2.5rem;
    }

    .modal-body .checking-img img {
        height: 2.4rem;
    }

    .modal-body .send-otp {
        height: 2.4rem;
        line-height: 2.4rem;
        font-size: 0.8rem;
    }

    .verify-submit {
        height: 46px;
        font-size: 20px;
    }

    .verify-steps__header {
        font-size: 16px;
    }

    .verify-steps__body {
        font-size: 13px;
    }

    .detail-table__head span {
        font-size: 14px;
    }

    .detail-table__body span {
        font-size: 14px;
    }

    .promo-ribbon__deco-1 {
        width: 50px;
        height: 50px;
    }

    .promo-ribbon__deco-2 {
        width: 50px;
        height: 50px;
    }
}

/* ===== Responsive: small mobile < 520px ===== */
@media (max-width: 520px) {
    .modal-body {
        padding: 8px 14px 20px;
    }

    .modal-body form dl.clearfix {
        padding: 4px 0;
    }

    .modal-body form dt {
        width: 100%;
        font-size: 0.75rem;
        margin: 0.25rem 0 0.15rem;
    }

    .modal-body form dd {
        width: 100%;
        padding-bottom: 0.1rem;
    }

    .modal-body form dd input.form-control {
        height: 2.2rem;
        font-size: 0.8rem;
        border-radius: 0.4rem;
    }

    .modal-body form dd input.form-control::placeholder {
        font-size: 0.75rem;
    }

    .modal-body .input-group-text {
        padding: 0 0.4rem;
        font-size: 0.75rem;
        border-radius: 0.4rem 0 0 0.4rem;
    }

    .modal-body .input-group .form-control {
        border-radius: 0 0.4rem 0.4rem 0;
    }

    .modal-body .flag_vn {
        width: 16px;
        height: 16px;
        margin-right: 3px;
    }

    .modal-body .icoo {
        width: 22px;
        top: 7px;
        left: 5px;
    }

    .modal-body .icoo + input.form-control {
        padding-left: 1.7rem;
    }

    .modal-body dd.checking input.form-control {
        padding-right: 6.5rem;
    }

    .modal-body .checking-img {
        width: 6rem;
        height: 2.2rem;
        line-height: 2.2rem;
    }

    .modal-body .checking-img img {
        height: 2.1rem;
        border-radius: 0 0.4rem 0.4rem 0;
    }

    .modal-body .send-otp {
        height: 2.1rem;
        line-height: 2.1rem;
        font-size: 0.7rem;
        border-radius: 0 0.4rem 0.4rem 0;
    }

    .modal-body .error-message {
        font-size: 11px;
    }

    .verify-submit {
        height: 40px;
        font-size: 18px;
        border-radius: 40px;
        margin-bottom: 12px;
    }

    .verify-steps__header {
        font-size: 14px;
        padding: 8px 0;
    }

    .verify-steps__body {
        font-size: 12px;
        padding: 8px 0;
    }

    .modal-title-img {
        max-width: 280px;
    }

    .modal-container {
        width: 94vw;
    }
}
