/* Modal Overlay with Blur Background */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    /* Prevent modal from moving when keyboard appears on mobile */
    max-height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    /* Prevent modal from moving when keyboard appears */
    overscroll-behavior: contain;
    /* Lock position - don't allow viewport to shift */
    touch-action: pan-y;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: auto;
    /* Prevent container from shifting when keyboard appears */
    flex-shrink: 0;
    /* Keep modal centered and prevent shift */
    align-self: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.25);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-form-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* Logo Section */
.modal-logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal-logo {
    height: 52px;
    width: auto;
}

/* Banner Section */
.modal-banner-section {
    border-radius: 12px;
    background: #6316DB;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25), 4px 4px 4px 0 #9582EF inset;
    backdrop-filter: blur(2px);
    display: flex;
padding: 16px;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 8px;
align-self: stretch;
}

.modal-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.modal-check-icon {
    width: 23px;
    height: 19px;
    flex-shrink: 0;
}

.modal-banner-text {
    font-family: 'year', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
    color: #FFD700;
    text-align: center;
    margin: 0;
}

/* Price Banner */
.modal-price-banner {
    background: #FFD700;
    border-radius: 12px;
    padding: 16px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
    width: 100%;
}

.modal-coin-icon {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.modal-price-text {
    font-family: 'year', sans-serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
    color: #2d2d2d;
    margin: 0;
    text-align: center;
}

/* Warning Section */
.modal-warning-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    width: 100%;
}

.modal-warning-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-warning-icon {
    width: 22px;
    height: 24px;
    flex-shrink: 0;
}

.modal-warning-text {
    font-family: 'year', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: #FFD700;
    text-align: center;
    margin: 0;
}

.modal-warning-subtext {
    font-family: 'Montserrat-Arabic', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: white;
    text-align: center;
    margin: 0;
}

/* Form Section */
.modal-form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.modal-input-group {
    position: relative;
    width: 100%;
}

.modal-input {
    width: 100%;
    padding: 16px 48px;
    border: 1px solid #6316db;
    border-radius: 32px;
    font-family: 'Montserrat-Arabic', sans-serif;
    font-size: 14px;
    color: #6316db;
    background: white;
    text-align: right;
    outline: none;
    transition: all 0.3s ease;
}

.modal-input::placeholder {
    color: #6316db;
    opacity: 0.5;
}

.modal-input:focus {
    border-color: #6316db;
    box-shadow: 0 0 0 3px rgba(99, 22, 219, 0.1);
}

.modal-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.modal-error-message {
    display: none;
    color: #dc2626;
    font-family: 'Montserrat-Arabic', sans-serif;
    font-size: 12px;
    margin-top: 4px;
    margin-right: 48px;
    text-align: right;
}

.modal-input-group {
    position: relative;
}

.modal-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 48px;
    padding-left: 60px;
}

.modal-select-arrow {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    pointer-events: none;
    width: 18px;
    height: 9px;
}

/* Submit Section */
.modal-submit-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 24px;
}

.modal-submit-button {
    background: #6316db;
    border-radius: 32px;
    padding: 16px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: none;
    cursor: pointer;
    box-shadow: 4px 4px 4px 0px rgba(0, 0, 0, 0.25);
    position: relative;
    transition: all 0.3s ease;
}

.modal-submit-button:hover {
    background: #7a2ff0;
    transform: translateY(-2px);
    box-shadow: 6px 6px 8px 0px rgba(0, 0, 0, 0.3);
}

.modal-submit-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 32px;
    box-shadow: inset 3px 4px 4px 0px #9582ef;
    pointer-events: none;
}

.modal-submit-text {
    font-family: 'year', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
    color: white;
    margin: 0;
}

.modal-submit-arrow {
    width: 19px;
    height: 23px;
    transform: rotate(180deg);
    flex-shrink: 0;
}

.modal-footer-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.modal-footer-icon {
    width: 18px;
    height: 20px;
    flex-shrink: 0;
}

.modal-footer-text {
    font-family: 'Montserrat-Arabic', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6316db;
    margin: 0;
}


/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    /* Prevent viewport shift on mobile when keyboard appears */
    /* Scroll position is saved/restored by JavaScript */
}

/* Thank You Box Styles */
.modal-thank-you {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 32px;
}

/* Checkmark Animation Keyframes */
@keyframes checkmarkScale {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmarkBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes checkmarkPulse {
    0%, 100% {
        filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.2));
    }
    50% {
        filter: drop-shadow(0px 8px 16px rgba(149, 130, 239, 0.4));
    }
}

.thank-you-checkmark {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    animation: checkmarkScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.thank-you-checkmark svg,
.thank-you-checkmark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.2));
    animation: checkmarkBounce 2s ease-in-out 0.6s infinite, checkmarkPulse 2s ease-in-out 0.6s infinite;
}

.thank-you-title {
    font-family: 'year', sans-serif;
    font-size: 48px;
    font-weight: 400;
    line-height: 72px;
    color: #FB2576;
    text-align: center;
    margin: 0;
}

.thank-you-message-box {
    border: 1px solid #9582ef;
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thank-you-message {
    font-family: 'Montserrat-Arabic', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #9582ef;
    text-align: center;
    margin: 0;
}

.thank-you-logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 8px;
}

.thank-you-logo {
    height: 29px;
    width: auto;
}

/* Hide form content when thank you is shown */
.modal-form-content.hidden {
    display: none;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .modal-overlay {
        padding: 16px;
    }
    .modal-container {
        max-width: 90%;
    }
    .modal-content {
        padding: 24px;
        gap: 24px;
    }
    .modal-form-content {
        gap: 24px;
    }
    .modal-logo {
        height: 44px;
    }
    .modal-banner-section {
        padding: 14px;
        gap: 6px;
    }
    .modal-check-icon {
        width: 20px;
        height: 16px;
    }
    .modal-banner-text {
        font-size: 20px;
        line-height: 28px;
    }
    .modal-price-banner {
        padding: 14px 32px;
        gap: 8px;
    }
    .modal-coin-icon {
        width: 60px;
        height: 60px;
    }
    .modal-price-text {
        font-size: 20px;
        line-height: 28px;
    }
    .modal-warning-section {
        gap: 24px;
    }
    .modal-warning-icon {
        width: 20px;
        height: 22px;
    }
    .modal-warning-text {
        font-size: 11px;
        line-height: 15px;
    }
    .modal-warning-subtext {
        font-size: 12px;
    }
    .modal-form-section {
        gap: 14px;
    }
    .modal-input {
        padding: 14px 40px;
        font-size: 13px;
    }
    .modal-error-message {
        font-size: 11px;
        margin-right: 40px;
    }
    .modal-select {
        padding-right: 40px;
        padding-left: 50px;
    }
    .modal-select-arrow {
        left: 40px;
        width: 16px;
        height: 8px;
    }
    .modal-submit-section {
        gap: 6px;
        margin-top: 20px;
    }
    .modal-submit-button {
        padding: 14px 40px;
        gap: 14px;
    }
    .modal-submit-text {
        font-size: 20px;
        line-height: 28px;
    }
    .modal-submit-arrow {
        width: 17px;
        height: 21px;
    }
    .modal-footer-icon {
        width: 16px;
        height: 18px;
    }
    .modal-footer-text {
        font-size: 12px;
    }
    .modal-thank-you {
        padding: 24px;
        gap: 14px;
    }
    .thank-you-checkmark {
        width: 160px;
        height: 160px;
    }
    .thank-you-title {
        font-size: 40px;
        line-height: 56px;
    }
    .thank-you-message-box {
        padding: 14px;
        gap: 6px;
    }
    .thank-you-message {
        font-size: 12px;
    }
    .thank-you-logo {
        height: 24px;
    }
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 12px;
    }
    .modal-container {
        max-width: 95%;
    }
    .modal-content {
        padding: 20px;
        gap: 20px;
    }
    .modal-form-content {
        gap: 20px;
    }
    .modal-logo {
        height: 40px;
    }
    .modal-banner-section {
        padding: 12px;
        gap: 6px;
    }
    .modal-banner-content {
        gap: 12px;
    }
    .modal-check-icon {
        width: 18px;
        height: 15px;
    }
    .modal-banner-text {
        font-size: 18px;
        line-height: 26px;
    }
    .modal-price-banner {
        padding: 12px 24px;
        gap: 6px;
    }
    .modal-coin-icon {
        width: 50px;
        height: 50px;
    }
    .modal-price-text {
        font-size: 18px;
        line-height: 26px;
    }
    .modal-warning-section {
        gap: 20px;
        flex-direction: column;
    }
    .modal-warning-left {
        gap: 8px;
    }
    .modal-warning-icon {
        width: 18px;
        height: 20px;
    }
    .modal-warning-text {
        font-size: 10px;
        line-height: 14px;
    }
    .modal-warning-subtext {
        font-size: 11px;
    }
    .modal-form-section {
        gap: 12px;
    }
    .modal-input {
        padding: 12px 32px;
        font-size: 12px;
    }
    .modal-error-message {
        font-size: 10px;
        margin-right: 32px;
    }
    .modal-select {
        padding-right: 32px;
        padding-left: 40px;
    }
    .modal-select-arrow {
        left: 32px;
        width: 14px;
        height: 7px;
    }
    .modal-submit-section {
        gap: 6px;
        margin-top: 16px;
    }
    .modal-submit-button {
        padding: 12px 32px;
        gap: 12px;
    }
    .modal-submit-text {
        font-size: 18px;
        line-height: 26px;
    }
    .modal-submit-arrow {
        width: 16px;
        height: 20px;
    }
    .modal-footer-message {
        gap: 4px;
    }
    .modal-footer-icon {
        width: 14px;
        height: 16px;
    }
    .modal-footer-text {
        font-size: 11px;
    }
    .modal-thank-you {
        padding: 20px;
        gap: 12px;
    }
    .thank-you-checkmark {
        width: 140px;
        height: 140px;
    }
    .thank-you-title {
        font-size: 32px;
        line-height: 48px;
    }
    .thank-you-message-box {
        padding: 12px;
        gap: 6px;
    }
    .thank-you-message {
        font-size: 11px;
    }
    .thank-you-logo {
        height: 20px;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 8px;
    }
    .modal-container {
        max-width: 100%;
    }
    .modal-content {
        padding: 16px;
        gap: 16px;
        max-height: 95vh;
    }
    .modal-form-content {
        gap: 16px;
    }
    .modal-logo {
        height: 36px;
    }
    .modal-banner-section {
        padding: 10px;
        gap: 6px;
    }
    .modal-banner-content {
        gap: 10px;
        flex-wrap: wrap;
    }
    .modal-check-icon {
        width: 16px;
        height: 13px;
    }
    .modal-banner-text {
        font-size: 16px;
        line-height: 22px;
    }
    .modal-price-banner {
        padding: 10px 16px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .modal-coin-icon {
        width: 40px;
        height: 40px;
    }
    .modal-price-text {
        font-size: 16px;
        line-height: 22px;
    }
    .modal-warning-section {
        gap: 16px;
        flex-direction: column;
    }
    .modal-warning-left {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .modal-warning-icon {
        width: 16px;
        height: 18px;
    }
    .modal-warning-text {
        font-size: 9px;
        line-height: 13px;
    }
    .modal-warning-subtext {
        font-size: 10px;
    }
    .modal-form-section {
        gap: 10px;
    }
    .modal-input {
        padding: 10px 24px;
        font-size: 11px;
        border-radius: 24px;
    }
    .modal-error-message {
        font-size: 9px;
        margin-right: 24px;
    }
    .modal-select {
        padding-right: 24px;
        padding-left: 32px;
    }
    .modal-select-arrow {
        left: 24px;
        width: 12px;
        height: 6px;
    }
    .modal-submit-section {
        gap: 6px;
        margin-top: 12px;
    }
    .modal-submit-button {
        padding: 10px 24px;
        gap: 10px;
        border-radius: 24px;
    }
    .modal-submit-text {
        font-size: 16px;
        line-height: 22px;
    }
    .modal-submit-arrow {
        width: 14px;
        height: 18px;
    }
    .modal-footer-message {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .modal-footer-icon {
        width: 12px;
        height: 14px;
    }
    .modal-footer-text {
        font-size: 10px;
    }
    .modal-thank-you {
        padding: 16px;
        gap: 12px;
    }
    .thank-you-checkmark {
        width: 120px;
        height: 120px;
    }
    .thank-you-title {
        font-size: 28px;
        line-height: 40px;
    }
    .thank-you-message-box {
        padding: 10px;
        gap: 6px;
    }
    .thank-you-message {
        font-size: 10px;
    }
    .thank-you-logo {
        height: 18px;
    }
}

