/* style-popup.css — Payment Modal Premium Redesign */

/* === BACKDROP === */
.modal-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 20px;
    overflow-y: auto; /* Allow vertical scrolling when content exceeds viewport */
}

/* === MODAL BOX === */
.modal-box {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    padding: 26px 22px 20px;
    margin: auto; /* Center modal perfectly and allow clean scrolling without cutoff */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* === CLOSE BUTTON === */
.modal-close-btn {
    position: absolute;
    top: 14px; right: 14px;
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    z-index: 10;
}
.modal-close-btn:hover {
    background: var(--btn-secondary-hover-bg);
    color: var(--text-main);
    transform: rotate(90deg);
}

/* === HEADER === */
.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-right: 32px; /* avoid overlap with close btn */
}

.modal-icon-wrap {
    width: 46px; height: 46px;
    border-radius: 13px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.modal-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 3px;
    line-height: 1.2;
}

.modal-header p {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* === TIMER SECTION === */
.modal-timer-section {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 12px;
    padding: 11px 15px;
    margin-bottom: 18px;
}

.modal-timer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-timer-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #f87171;
    font-weight: 500;
}

.modal-timer-count {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ef4444;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1.5px;
}

.modal-timer-bar {
    height: 4px;
    background: rgba(239, 68, 68, 0.12);
    border-radius: 99px;
    overflow: hidden;
}

.modal-timer-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 99px;
    transition: width 1s linear;
    transform-origin: left;
}

/* === QRIS AREA === */
.qris-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.qris-frame {
    position: relative;
    background: white;
    padding: 13px;
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.08),
        0 8px 24px rgba(0,0,0,0.15);
}

.qris-scanner-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: #2563eb;
    animation: qrisScan 2.4s ease-in-out infinite;
    z-index: 2;
    border-radius: 99px;
}

@keyframes qrisScan {
    0%   { top: 0%;   opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.qris-container img, .qris-container svg {
    display: block;
    width: 196px;
    height: 196px;
    object-fit: contain;
    border-radius: 4px;
}

/* QR Corner Marks */
.qris-corner {
    position: absolute;
    width: 20px; height: 20px;
    border-color: #2563eb;
    border-style: solid;
    border-width: 0;
    opacity: 0.8;
}
.qris-corner--tl { top: 7px; left: 7px; border-top-width: 3px; border-left-width: 3px; border-radius: 3px 0 0 0; }
.qris-corner--tr { top: 7px; right: 7px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 3px 0 0; }
.qris-corner--bl { bottom: 7px; left: 7px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 3px; }
.qris-corner--br { bottom: 7px; right: 7px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 3px 0; }

.qris-hint {
    font-size: 0.71rem;
    color: #475569;
    margin-top: 9px;
    letter-spacing: 0.3px;
}

/* === EWALLET BADGES === */
.modal-ewallet-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-bottom: 18px;
}

.ewallet-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    border-radius: 8px;
    height: 28px;
    padding: 0 10px;
    transition: background 0.2s;
}
.ewallet-badge:hover {
    background: var(--btn-secondary-hover-bg);
}

.ewallet-badge img {
    height: 14px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.55;
}

body.light-mode .ewallet-badge img {
    filter: none;
    opacity: 0.85;
}

.ewallet-badge--text {
    font-size: 0.67rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* === FOOTER ACTIONS === */
.modal-footer-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 12px;
}

.btn-download-wrapper {
    flex: 1;
    text-decoration: none;
}

.btn-download {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    background: var(--brand-gradient);
    border: none;
    border-radius: 11px;
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    letter-spacing: 0.2px;
}

.btn-download:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42);
}

.btn-tutup-modal {
    height: 44px;
    padding: 0 16px;
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-tutup-modal:hover {
    background: var(--btn-secondary-hover-bg);
    color: var(--text-main);
}

.btn-secondary {
    height: 44px;
    padding: 0 16px;
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
    color: var(--text-main);
    border-color: var(--border-hover);
}

/* === SAFETY NOTE === */
.modal-safety-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #334155;
    text-align: center;
}
.modal-safety-note svg {
    color: rgba(34, 197, 94, 0.5);
    flex-shrink: 0;
}

/* === MODAL SUKSES (High Fidelity Delivery Modal) === */
.modal-box--sukses {
    border-color:  var(--success-border);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 24px 64px rgba(0,0,0,0.65),
        0 0 80px rgba(34, 197, 94, 0.12);
    text-align: center;
}

.success-animation {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px;
}

.checkmark {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #22c55e;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #22c55e;
    animation: fillCheckmark .4s ease-in-out .4s forwards, scaleCheckmark .3s ease-in-out .9s forwards;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #22c55e;
    fill: none;
    animation: strokeCheckmark .6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheckmark .3s cubic-bezier(0.65, 0, 0.45, 1) .8s forwards;
}

@keyframes strokeCheckmark {
    100% { stroke-dashoffset: 0; }
}

@keyframes fillCheckmark {
    100% { box-shadow: inset 0px 0px 0px 34px rgba(34, 197, 94, 0.1); }
}

@keyframes scaleCheckmark {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

.success-title {
    font-size: 1.38rem;
    font-weight: 800;
    color: #22c55e;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.success-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.4;
}

/* Delivered Product Card */
.delivered-card {
    background: var(--input-bg);
    border: 0.8px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.delivered-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.delivered-product {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
}

.delivered-order-id {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
}

.delivered-credentials {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cred-label {
    font-size: 0.7rem;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cred-value-wrap {
    display: flex;
    align-items: center;
    background: #090d16;
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 3px 3px 3px 12px;
}

.cred-value {
    flex: 1;
    font-family: monospace;
    font-size: 0.82rem;
    color: #60a5fa;
    word-break: break-all;
    user-select: all;
}

.btn-copy-cred {
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-cred:hover {
    background: var(--primary);
    color: white;
}

.success-note {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* === MODAL GARANSI === */
.modal-box--garansi {
    border-color:  var(--danger-border);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 24px 64px rgba(0,0,0,0.65),
        0 0 80px rgba(239, 68, 68, 0.12);
}

#garansi-info-order {
    font-family: monospace;
    font-weight: bold;
    color: #f87171;
}

/* === STOCK INDICATOR STYLE === */
.stock-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 6px;
    letter-spacing: 0.2px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid var(--success-border);
    color: #10b981;
}

.stock-badge.out-of-stock {
    background: rgba(239, 68, 68, 0.08);
    border-color:  var(--danger-border);
    color: #ef4444;
}

/* === CEK PESANAN FORM === */
.cek-form-grid {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.cek-form-grid .smm-form-group {
    flex: 1;
    margin-bottom: 0;
}

.cek-divider-text {
    font-size: 0.7rem;
    color: #60a5fa;
    background: #151f32;
    border: 1px solid var(--border);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    align-self: flex-end;
    margin-bottom: 5px; /* Perfect alignment with inputs */
}

/* Accents for divider in desktop */
.cek-divider-text::before,
.cek-divider-text::after {
    content: "";
    position: absolute;
    background: linear-gradient(to right, rgba(37, 99, 235, 0) 0%, rgba(37, 99, 235, 0.25) 50%, rgba(37, 99, 235, 0) 100%);
    height: 1px;
    width: 30px;
    top: 50%;
    z-index: -1;
}

.cek-divider-text::before {
    right: 100%;
}

.cek-divider-text::after {
    left: 100%;
}

@media(max-width: 768px) {
    .cek-form-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .cek-divider-text {
        align-self: center;
        margin-bottom: 0;
        margin-top: 4px;
        height: 32px;
        width: 32px;
        font-size: 0.65rem;
    }
    .cek-divider-text::before,
    .cek-divider-text::after {
        display: none;
    }
    .cek-form-grid .smm-form-group {
        width: 100%;
    }
}

/* PREMIUM INPUT ZONE */
.input-with-icon-premium {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.premium-input-icon {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.smm-input-premium {
    width: 100%;
    padding: 14px 16px 14px 46px; /* Offset left for icon */
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.smm-input-premium:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), inset 0 2px 4px rgba(0,0,0,0.05);
    background: var(--input-bg);
}

.input-with-icon-premium:focus-within .premium-input-icon {
    color: #60a5fa;
    transform: scale(1.1);
}

.smm-input-premium::placeholder {
    color: rgba(148, 163, 184, 0.4);
}


.section-title-premium {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #f8fafc;
}

/* Transaction detail cards */
.cek-results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 60px;
}

.tx-detail-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 20px;
    border: 0.8px solid var(--border);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.02), 
                0 8px 28px -12px rgba(0, 0, 0, 0.6);
}

.tx-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.tx-prod-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #f8fafc;
}

.tx-status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.tx-status-badge.lunas {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid var(--success-border);
}

.tx-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.tx-lbl {
    color: #64748b;
}

.tx-val {
    color: #e2e8f0;
    font-weight: 500;
}

.tx-val--monospace {
    font-family: monospace;
    font-weight: bold;
}

.tx-val--success {
    color: var(--info-text);
    font-family: monospace;
    background: var(--input-bg);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    word-break: break-all;
    width: 100%;
    margin-top: 6px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.btn-complain {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 8px;
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-complain:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-complain.garansi-claimed {
    background: rgba(255,255,255,0.03) !important;
    border-color:  var(--border) !important;
    color: #475569 !important;
    cursor: not-allowed;
}

/* === PREMIUM UPGRADE STEPPER === */
.upgrade-stepper {
    margin-top: 12px;
    padding: 16px;
    background: var(--stepper-bg);
    border: 1px solid var(--stepper-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.upgrade-stepper::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.stepper-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--primary);
}

.stepper-icon-pulse {
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: none;
    animation: stepperPulse 1.8s infinite;
}

@keyframes stepperPulse {
    0% { transform: scale(0.9); }
    70% { transform: scale(1); }
    100% { transform: scale(0.9); }
}

.stepper-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stepper-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    padding-left: 20px;
}

.stepper-timeline::before {
    content: '';
    position: absolute;
    left: 4px; top: 8px;
    bottom: 8px; width: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.stepper-line-active {
    position: absolute;
    left: 4px; top: 8px;
    height: 50%; width: 2px;
    background: linear-gradient(to bottom, #22c55e, #2563eb);
    box-shadow: none;
}

.stepper-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.stepper-badge {
    position: absolute;
    left: -20px; top: 3px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border);
    box-shadow: 0 0 0 3px var(--card-bg);
    transition: all 0.3s ease;
}

.stepper-item.completed .stepper-badge {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px var(--card-bg);
}

.stepper-item.active .stepper-badge {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--card-bg);
    animation: activeBadgePulse 1.5s infinite;
}

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

.stepper-content {
    display: flex;
    flex-direction: column;
}

.stepper-step-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
    transition: color 0.3s ease;
}

.stepper-item.completed .stepper-step-title {
    color: #4ade80;
}

.stepper-item.active .stepper-step-title {
    color: #f8fafc;
}

.stepper-desc {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.stepper-item.active .stepper-desc {
    color: #94a3b8;
}

.stepper-footer-note {
    font-size: 0.72rem;
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.1);
    border: 1px dashed var(--primary);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    margin-top: 15px;
    line-height: 1.4;
}

