/* =========================================
   1. MODAL OVERLAY & CONTAINER
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 11, 15, 0.95); /* Dark transparent background */
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.modal-window {
    background-color: #132029;
    width: 90%;
    max-width: 420px;
    border-radius: 28px;
    border: 1px solid #233541;
    position: relative;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #1c2b36;
    border: none;
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
}

/* Modal Stage Visibility */
.modal-stage {
    display: none;
}

.modal-stage.active {
    display: block;
}

/* =========================================
   2. STAGE 1: DETAILS (IMAGE 1)
   ========================================= */
.modal-top-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-brand-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

.modal-brand-name {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.modal-offer-title {
    font-size: 1.3rem;
    color: white;
}

.verified-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: white;
}

/* Ticket Style Box with Cutouts */
.coupon-ticket-box {
    background: rgba(0, 194, 255, 0.05);
    border: 2px dashed var(--accent-cyan);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.ticket-cutout-left, .ticket-cutout-right {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background-color: #132029; /* Matches modal background */
    border-radius: 50%;
    transform: translateY(-50%);
}

.ticket-cutout-left { left: -12px; border-right: 2px dashed var(--accent-cyan); }
.ticket-cutout-right { right: -12px; border-left: 2px dashed var(--accent-cyan); }

.coupon-ticket-box h2 {
    color: var(--accent-cyan);
    font-size: 1.6rem;
}

/* Stats Row */
.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid #233541;
    border-bottom: 1px solid #233541;
    padding: 15px 0;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    font-size: 0.9rem;
    color: white;
    font-weight: bold;
}

.stat-item span {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: normal;
}

.modal-description {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 25px;
    max-height: 120px;
    overflow-y: auto;
}

/* =========================================
   3. STAGE 2: LOADING (IMAGE 3)
   ========================================= */
.loading-wrap {
    text-align: center;
    padding: 40px 0;
}

.progress-circle-container {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    position: relative;
}

.progress-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(closest-side, #132029 80%, transparent 0 100%),
                conic-gradient(var(--accent-cyan) var(--progress, 0%), #233541 0);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.loading-msg {
    color: var(--text-gray);
}

/* =========================================
   4. STAGE 3: VALIDATION (IMAGE 2)
   ========================================= */
.success-wrap {
    text-align: center;
    padding: 60px 0;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    border: 4px solid var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    color: var(--accent-cyan);
    margin: 0 auto 20px;
}

/* =========================================
   5. STAGE 4: FINAL CODE (IMAGE 4)
   ========================================= */
.locked-code-box {
    background: #0b141b;
    border: 2px dashed #2d3d4a;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.blur-code {
    font-size: 1.4rem;
    letter-spacing: 4px;
    color: var(--accent-cyan);
    filter: blur(6px);
    font-family: monospace;
}

.lock-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1c2b36;
    color: var(--danger-red);
    padding: 6px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.8rem;
    border: 1px solid #334155;
}

.final-title { text-align: center; font-size: 1.3rem; }
.final-desc { text-align: center; color: var(--text-gray); font-size: 0.9rem; margin-top: 10px; }

/* Utilities */
.btn-full { width: 100%; margin-top: 10px; }