/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html,
body {
    height: 100%;
    background: #060C2B;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== DESKTOP WRAPPER — center mobile view ===== */
.page-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: #060C2B;
}

.mobile-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f1535 0%, #0a0e1a 100%);
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    width: 100%;
    background: linear-gradient(270deg, #050C2B 0%, #001742 52.08%, #050C2B 100%);
    border-bottom: 1px solid #293F54;
    position: relative;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
}

.header-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* ===== CONTENT ===== */
.content {
    padding: 25px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}

.content form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content form .section:last-of-type {
    flex: 1;
}

/* ===== INTRO ===== */
.intro {
    margin-bottom: 12px;
}

.intro-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intro-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.intro-text {
    font-weight: 500;
    font-size: 14px;
    color: #A2AFC9;
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: 16px;
}

.section-title {
    font-weight: 600;
    font-size: 16px;
    line-height: 32px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== CHIPS ===== */
.chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #293F54;
    background: #7F7F8FA1;
    color: #ffffff;
    
    font-weight: 500;
    font-size: 14px;
    vertical-align: middle;


    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chip:last-child {
    background: transparent;
}

.chip:hover,
.chip:last-child:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.chip.active,
.chip:last-child.active {
    background: 
        linear-gradient(rgba(127, 127, 143, 0), rgba(127, 127, 143, 0)),
        radial-gradient(
            212% 154% at 50% -6%,
            #171652 30%,
            #3532B8 100%
        );
    border: 1px solid #293F54;
}

/* ===== UNIFIED INPUT ===== */
.required-star {
    color: #FF5D5D;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #293F54;
    border-radius: 8px;
    padding: 12px 18px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.other-input-wrapper {
    margin-top: 8px;
}

.input-wrapper:focus-within {
    border-color: #4a6cf7;
}

/* Validation states */
.input-wrapper.has-error {
    border-color: #FF5D5D;
}

.input-wrapper.has-error:focus-within {
    border-color: #FF5D5D;
}

.input-wrapper.is-valid {
    border-color: #32EC3A;
}

.input-wrapper.is-valid:focus-within {
    border-color: #32EC3A;
}

.input-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 10px;
    line-height: 16px;
}

.input-field::placeholder {
    color: #A2AFC9;
}

/* Override browser autofill styles */
.input-field:-webkit-autofill,
.input-field:-webkit-autofill:hover,
.input-field:-webkit-autofill:focus,
.input-field:-webkit-autofill:active,
.input-field:-internal-autofill-selected,
.input-field:-internal-autofill-selected:hover,
.input-field:-internal-autofill-selected:focus,
.input-field:-internal-autofill-selected:active {
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: transparent !important;
    background: transparent !important;
    caret-color: #fff !important;
    box-shadow: inset 0 0 20px 20px transparent !important;
    -webkit-box-shadow: inset 0 0 20px 20px transparent !important;
    background-clip: text !important;
    transition: background-color 9999s ease-in-out 0s !important;
    -webkit-transition-delay: 9999s;
    transition-delay: 9999s;
}

/* Email input — slightly larger font */
.email-label {
    margin-bottom: 0px;
}

.email-wrapper .input-field {
    font-size: 14px;
}

.email-wrapper .input-icon {
    width: 20px;
    height: 20px;
}

.email-wrapper .input-field::placeholder {
    color: #A2AFC966;
}

/* Field error message */
.field-error {
    display: none;
    margin-top: 4px;
    margin-left: 4px;
    font-weight: 400;
    font-size: 11px;
    line-height: 16px;
    color: #FF5D5D;
    transition: opacity 0.2s ease;
}

.field-error:not(:empty) {
    display: block;
}

/* ===== COMMENT TEXTAREA ===== */
.textarea-wrapper {
    position: relative;
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px 18px;
    padding-bottom: 28px;
    background: transparent;
    border: 1px solid #293F54;
    border-radius: 12px;
    color: #ffffff;

    font-weight: 500;
    font-size: 10px;
    line-height: 16px;

    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.comment-textarea:focus {
    border-color: #4a6cf7;
}

.comment-textarea::placeholder {
    color: #A2AFC9;
}

.char-counter {
    display: block;
    margin-top: 4px;
    margin-left: 20px;
    color: #A2AFC9;

    font-weight: 500;
    font-size: 10px;
    line-height: 16px;

}

/* ===== PRIMARY BUTTON (COMMON) ===== */
.btn-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 8px;
    
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    color: #060C2B;

    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;

    position: relative;
    overflow: hidden;

    background: radial-gradient(50.49% 359.49% at 50% 50%, #FFAD00 28%, #FEE000 100%);
    box-shadow: 0px 0px 4px 0px #FFAD00,
                0px 0px 5px 0px #FFFFFF,
                1px 4px 10.6px 1px #FFFFFF9C inset;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-bg-left,
.btn-bg-right {
    pointer-events: none;
    position: absolute;
    top: 0;
    bottom: 0;
    height: 100%;
    width: fit-content;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.btn-bg-left {
    left: 0;
}

.btn-bg-right {
    right: 0;
    rotate: 180deg;
}

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
    margin-top: 8px;
}

.btn-submit:disabled {
    background: radial-gradient(147% 147% at 7% -47%, #293F54 20%, #A2AFC9 100%);
    border: 1px solid #A2AFC9;
    color: #060C2B;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-submit:not(:disabled) {
    background: radial-gradient(50% 359% at 50% 50%, #FFAD00 28%, #FEE000 100%);
    box-shadow: 0px 0px 4px 0px #FFAD00,
                0px 0px 5px 0px #FFFFFF,
                1px 4px 10px 1px #FFFFFF9C inset;
}

.btn-submit:not(:disabled):active {
    transform: scale(0.98);
}

.btn-submit:disabled .btn-bg-left,
.btn-submit:disabled .btn-bg-right {
   opacity: 0;
}

/* ===== POPUP OVERLAY ===== */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #12022FCC;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    padding: 24px;
    overflow-y: auto;
}

.popup-overlay.show {
    display: flex;
}

/* Block body scroll when popup is open */
body.popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ===== POPUP ===== */
.popup {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: linear-gradient(180deg, rgba(0, 0, 255, 0.5) 0%, rgba(162, 0, 187, 0.5) 100%);
    border: 2px solid #FFFFFF7A;
    border-radius: 12px;
    text-align: center;
    overflow: visible;
    animation: popupIn 0.4s ease-out;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== POPUP BODY (inner padding container) ===== */
.popup-body {
    padding: 0 20px;
    padding-top: 32px;
    padding-bottom: 40px;
}

/* ===== ROBOT — centered at top ===== */
.popup-robot {
    position: absolute;
    top: -115px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 145px;
    z-index: 3;
    animation: robotFloat 3s ease-in-out infinite;
}

/* ===== GIFTS — 3 presents ===== */
.popup-gift {
    position: absolute;
    width: 70px;
    height: auto;
    z-index: 2;
    pointer-events: none;
}

/* Bottom-left gift */
.popup-gift-1 {
    left: 0px;
    bottom: -50px;
    width: 50px;
    animation: giftBounce1 4s ease-in-out infinite;
}

/* Bottom-right gift */
.popup-gift-2 {
    right: 0px;
    bottom: -35px;
    width: 35px;
    animation: giftBounce2 4.5s ease-in-out infinite;
}

/* Top-left gift */
.popup-gift-3 {
    left: 5px;
    top: -40px;
    width: 80px;
    animation: giftBounce3 5.5s ease-in-out infinite;
}

/* Top-right gift */
.popup-gift-4 {
    right: -5px;
    top: -50px;
    width: 90px;
    animation: giftBounce4 2.5s ease-in-out infinite;
}

@keyframes giftBounce1 {
    0%, 100% { transform: translateY(0) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-3deg); }
}

@keyframes giftBounce2 {
    0%, 100% { transform: translateY(0) rotate(-6deg) scaleX(-1); }
    50% { transform: translateY(-8px) rotate(2deg) scaleX(-1); }
}

@keyframes giftBounce3 {
    0%, 100% { transform: translateY(0) rotate(6deg); }
    50% { transform: translateY(-14px) rotate(-5deg); }
}

@keyframes giftBounce4 {
    0%, 100% { transform: translateY(0) rotate(-7deg); }
    50% { transform: translateY(-16px) rotate(5deg); }
}

@keyframes robotFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* ===== POPUP TEXT ===== */
.popup-title {
    font-weight: 700;
    font-size: 24px;
    line-height: 130%;
    text-align: center;
    vertical-align: middle;
    text-shadow: 4px -2px 0px #3300FF;
    margin-bottom: 8px;
}

.popup-text {
    font-weight: 400;
    font-size: 16px;
    line-height: 130%;
    letter-spacing: 0%;
    text-align: center;
    vertical-align: middle;
}

.popup-text-bonus {
    margin-bottom: 12px;
}

.popup-text strong {
}

/* ===== PROMO ROW ===== */
.promo-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #FFFFFF;
    border-radius: 8px;
    background: #6FB7FF1A;
    margin-bottom: 16px;
    height: 38px;
    width: 100%;
}

.promo-code {
    font-weight: 700;
    font-size: 16px;
    line-height: 130%;
    letter-spacing: 0%;
    text-align: center;
    vertical-align: middle;
    text-transform: capitalize;
    color: #FBFF00;
}

.btn-copy {
    position: absolute;
    right: 4px;
    top: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 81px;
    height: 28px;
    background: #ffffff;
    border: none;
    border-radius: 6px;
    color: #3300FF;

    font-weight: 500;
    font-size: 14px;
    line-height: 130%;
    text-align: center;
    vertical-align: middle;
    text-transform: capitalize;

    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-copy:active {
    background: #e8e8e8;
    transform: scale(0.96);
}

/* ===== CLAIM BUTTON ===== */
.btn-claim {
    text-decoration: none;
    font-weight: 700;
}

/* ===== TICKET CONTAINER (How It Works) ===== */
.ticket-container {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: 100%;
    max-width: 260px;
    z-index: 5;
}

.ticket-bg {
    width: 100%;
    height: auto;
    display: block;
}

.ticket-content {
    rotate: -2.5deg;
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ticket-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 130%;
    text-align: center;
    vertical-align: middle;
    text-transform: capitalize;
    color: #3300FF;
    margin-bottom: 4px;
}

.ticket-steps {
    max-width: 220px;
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    counter-reset: step;
}

.ticket-steps li {
    font-weight: 400;
    font-size: 12px;
    line-height: 130%;
    text-align: center;
    vertical-align: middle;
    text-transform: capitalize;
    color: #00000091;
}

.ticket-steps li::before {
    content: attr(data-step) ". ";
}

.ticket-bonus {
    font-weight: 700;
    font-size: 14px;
    line-height: 130%;
    letter-spacing: 0%;
    text-align: center;
    vertical-align: middle;
    text-transform: capitalize;
    color: #0000FF;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: linear-gradient(180deg, rgba(0, 0, 255, 0.5) 0%, rgba(162, 0, 187, 0.5) 100%);
    border: 2px solid #FFFFFF7A;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.35s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== LOADING SPINNER ON SUBMIT ===== */
.btn-submit.loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 3px solid rgba(10, 14, 26, 0.3);
    border-top-color: #0a0e1a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
