/**
 * R2S Academy Payment Gateway - Cyber Dark Theme Stylesheet
 * Palette:
 *   - Background Primary: #0A192F
 *   - Surface / Card:     #1E293B
 *   - Cyber Teal Glow:    #06B6D4
 *   - Emerald CTA:        #10B981
 *   - Crimson Alert:      #EF4444
 */

:root {
    --r2s-bg-deep: #0A192F;
    --r2s-bg-card: #1E293B;
    --r2s-bg-elevated: #0F2442;
    --r2s-cyber-teal: #06B6D4;
    --r2s-emerald: #10B981;
    --r2s-crimson: #EF4444;
    --r2s-text-light: #F8FAFC;
    --r2s-text-muted: #94A3B8;
    --r2s-border: rgba(6, 182, 212, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background-color: var(--r2s-bg-deep);
    color: var(--r2s-text-light);
    scroll-behavior: smooth;
}

body {
    background-color: var(--r2s-bg-deep);
    background-image:
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.10) 0%, transparent 40%);
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Cyber Card & Glow Effects */
.cyber-card {
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid var(--r2s-border);
    box-shadow:
        0 20px 45px -15px rgba(2, 6, 23, 0.8),
        0 0 24px rgba(6, 182, 212, 0.08);
    backdrop-filter: blur(12px);
}

.cyber-card-glow {
    border-color: rgba(6, 182, 212, 0.45);
    box-shadow:
        0 20px 50px -12px rgba(2, 6, 23, 0.85),
        0 0 30px rgba(6, 182, 212, 0.16);
}

/* CTA Button Pulse Animations (Emerald & Crimson) */
@keyframes pulseEmerald {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55), 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0), 0 14px 30px -4px rgba(6, 182, 212, 0.5);
    }
}

@keyframes pulseCrimson {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.btn-cta-pulse {
    background: linear-gradient(135deg, #10B981 0%, #059669 50%, #06B6D4 100%);
    animation: pulseEmerald 2.2s infinite;
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn-cta-pulse:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.btn-cta-pulse:active:not(:disabled) {
    transform: translateY(0);
}

.btn-cta-pulse:disabled {
    animation: none;
    opacity: 0.68;
    cursor: not-allowed;
}

.badge-crimson-pulse {
    animation: pulseCrimson 2s infinite;
}

/* Form Accessibility, Sizing & Gestalt Proximity */
.form-group {
    margin-block-end: 1.35rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.925rem;
    color: #E2E8F0;
    margin-bottom: 0.2rem;
}

.field-hint {
    display: block;
    color: #94A3B8;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.cyber-input {
    width: 100%;
    font-size: 1rem; /* Ngăn iOS tự động zoom khi focus */
    padding: 0.75rem 1rem;
    min-height: 48px;
    border-radius: 0.625rem;
    background-color: rgba(10, 25, 47, 0.85);
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    color: #F8FAFC;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

@media (pointer: coarse) {
    .cyber-input {
        min-height: 52px;
    }
}

.cyber-input::placeholder {
    color: #64748B;
}

.cyber-input:focus-visible {
    outline: 3px solid var(--r2s-cyber-teal);
    outline-offset: 2px;
    border-color: var(--r2s-cyber-teal);
    background-color: rgba(15, 36, 66, 0.95);
}

/* Modern Web Guidance: Validate Input After Interaction (:user-invalid & :user-valid) */
.error-msg {
    display: none;
    color: #FCA5A5;
    background-color: rgba(239, 68, 68, 0.14);
    border-left: 3px solid var(--r2s-crimson);
    padding: 0.4rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 0.825rem;
    margin-top: 0.4rem;
}

.cyber-input:user-invalid,
.cyber-input.user-invalid-fallback {
    border-color: var(--r2s-crimson);
    background-color: rgba(239, 68, 68, 0.08);
}

.cyber-input:user-invalid + .error-msg,
.cyber-input.user-invalid-fallback + .error-msg {
    display: block;
}

.cyber-input:user-valid,
.cyber-input.user-valid-fallback {
    border-color: var(--r2s-emerald);
}

/* Native HTML5 <dialog> Modal & Backdrop */
dialog#vietqr-modal {
    border: 1px solid rgba(6, 182, 212, 0.45);
    background: linear-gradient(165deg, #1E293B 0%, #0A192F 100%);
    color: #F8FAFC;
    border-radius: 1rem;
    padding: 0;
    max-width: 34rem;
    width: calc(100% - 1.5rem);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow:
        0 25px 60px -15px rgba(0, 0, 0, 0.9),
        0 0 35px rgba(6, 182, 212, 0.25);
}

dialog#vietqr-modal::backdrop {
    background-color: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(5px);
}

/* Countdown Digital Box */
.countdown-box {
    background: rgba(10, 25, 47, 0.9);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 0.5rem;
    padding: 0.2rem 0.55rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #22D3EE;
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.15);
}

/* Table Scrollbar Styling */
.table-scroll::-webkit-scrollbar {
    height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    background: #0A192F;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #06B6D4;
}

