@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --accent: #00CECE;
    --success: #00B894;
    --success-bg: rgba(0,184,148,0.1);
    --error: #FF6B6B;
    --error-bg: rgba(255,107,107,0.1);
    --info: #74B9FF;
    --info-bg: rgba(116,185,255,0.1);
    --surface: #0F0F1A;
    --surface-2: #1A1A2E;
    --surface-3: #24243E;
    --text: #EAEAFF;
    --text-dim: #8888AA;
    --text-muted: #55557A;
    --border: rgba(108,92,231,0.15);
    --border-hover: rgba(108,92,231,0.4);
    --glow: 0 0 30px rgba(108,92,231,0.2);
    --radius-sm: 10px;
    --radius-xs: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--surface);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(108,92,231,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(0,206,206,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(162,155,254,0.05) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite alternate;
    z-index: 0; pointer-events: none;
}
@keyframes bgShift { 
    0% { transform: translate(0,0) rotate(0deg); } 
    100% { transform: translate(-3%,-3%) rotate(3deg); } 
}

body::after {
    content: ''; position: fixed; inset: 0;
    background-image: linear-gradient(rgba(108,92,231,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(108,92,231,0.03) 1px, transparent 1px);
    background-size: 60px 60px; z-index: 0; pointer-events: none;
}

.main-container { display: flex; min-height: 100vh; width: 100%; position: relative; z-index: 1; }

.info-pane {
    flex: 1; display: flex; justify-content: center; align-items: center; padding: 60px 50px;
    text-align: center; position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(108,92,231,0.12), rgba(0,206,206,0.06));
    border-right: 1px solid var(--border);
}
.info-pane::before {
    content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(108,92,231,0.15), transparent 70%);
    top: -100px; right: -150px; animation: pulse 6s ease-in-out infinite;
}
.info-pane::after {
    content: ''; position: absolute; width: 350px; height: 350px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,206,206,0.1), transparent 70%);
    bottom: -80px; left: -100px; animation: pulse 8s ease-in-out infinite reverse;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }

.info-content { max-width: 420px; position: relative; z-index: 2; }
.info-content .icon {
    width: 80px; height: 80px; margin: 0 auto 30px; padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 24px; color: white;
    filter: drop-shadow(0 8px 24px rgba(108,92,231,0.4));
    animation: floatIcon 4s ease-in-out infinite;
}
@keyframes floatIcon { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.info-content h1 {
    font-size: 2.8rem; font-weight: 800; line-height: 1.15; margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    letter-spacing: -0.02em;
}
.info-content p { font-size: 1.1rem; color: var(--text-dim); font-weight: 400; line-height: 1.7; }

.floating-shape {
    position: absolute; border: 1px solid rgba(108,92,231,0.15); border-radius: 12px;
    animation: floatShape 10s ease-in-out infinite; pointer-events: none;
}
.floating-shape:nth-child(1) { width: 40px; height: 40px; top: 15%; left: 10%; }
.floating-shape:nth-child(2) { width: 20px; height: 20px; bottom: 20%; right: 15%; animation-delay: -3s; border-radius: 50%; }
.floating-shape:nth-child(3) { width: 30px; height: 30px; top: 60%; left: 70%; animation-delay: -5s; }
@keyframes floatShape { 0%,100% { transform: translateY(0) rotate(0deg); opacity: 0.4; } 50% { transform: translateY(-20px) rotate(180deg); opacity: 0.8; } }

.form-pane { flex: 1; display: flex; justify-content: center; align-items: center; padding: 60px 50px; position: relative; }
.form-content { width: 100%; max-width: 420px; animation: fadeSlideUp 0.6s cubic-bezier(0.23,1,0.32,1) forwards; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.form-header { text-align: left; margin-bottom: 32px; }
.form-header h2 { font-size: 2rem; font-weight: 700; color: var(--text); margin: 0 0 8px 0; }
.form-header p { color: var(--text-dim); font-size: 0.95rem; margin: 0 0 18px 0; }

.telegram-btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 28px;
    background: linear-gradient(135deg, #0088CC, #00AAEE); color: #fff; text-decoration: none;
    border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.23,1,0.32,1);
    box-shadow: 0 4px 16px rgba(0,136,204,0.25); border: 1px solid rgba(255,255,255,0.1);
    position: relative; overflow: hidden;
    -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; outline: none;
}
.telegram-btn::before { content:''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent, rgba(255,255,255,0.12)); opacity: 0; transition: opacity 0.3s; }
.telegram-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 28px rgba(0,136,204,0.4); }
.telegram-btn:hover::before { opacity: 1; }
.telegram-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.stock-indicator {
    padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 28px;
    font-weight: 500; font-size: 0.9rem; background: var(--surface-2);
    border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; color: var(--text-dim);
}
.stock-indicator::before {
    content: ''; width: 8px; height: 8px; background: var(--success); border-radius: 50%;
    box-shadow: 0 0 8px rgba(0,184,148,0.6); animation: blink 2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.stock-count { color: var(--accent); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; }

/* Form Fields */
.form-group { margin-bottom: 24px; text-align: left; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }

/* FIX: Center specific OTP Label automatically */
.form-group:has(.otp-input-group) label {
    text-align: center !important;
    width: 100%;
}

input[type="tel"], input[type="text"] {
    width: 100%; padding: 16px 18px; background: var(--surface-2);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 1.05rem; font-family: 'Outfit', sans-serif; color: var(--text);
    transition: all 0.3s cubic-bezier(0.23,1,0.32,1); outline: none;
}
input::placeholder { color: var(--text-muted); }
input:hover { border-color: var(--border-hover); background: var(--surface-3); }
input:focus { border-color: var(--primary); background: var(--surface-3); box-shadow: 0 0 0 4px rgba(108,92,231,0.12), var(--glow); }

/* OTP 4-Digit Boxes */
.otp-input-group { display: flex; gap: 14px; justify-content: center; margin-bottom: 12px; margin-top: 12px; }
.otp-input-group input {
    width: 72px; height: 76px; text-align: center; font-size: 1.7rem;
    font-family: 'JetBrains Mono', monospace; font-weight: 700; padding: 0;
    background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); transition: all 0.3s cubic-bezier(0.23,1,0.32,1); caret-color: var(--accent);
    -moz-appearance: textfield;
}
.otp-input-group input::-webkit-inner-spin-button, .otp-input-group input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.otp-input-group input:hover { border-color: var(--border-hover); }
.otp-input-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,92,231,0.12), 0 0 20px rgba(108,92,231,0.15); transform: translateY(-2px); }
.otp-input-group input.filled { border-color: var(--accent); background: rgba(0,206,206,0.05); }

/* Primary Buttons */
.btn {
    width: 100%; padding: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 1rem; font-weight: 700; font-family: 'Outfit', sans-serif;
    transition: all 0.3s cubic-bezier(0.23,1,0.32,1); position: relative; overflow: hidden;
    box-shadow: 0 4px 20px rgba(108,92,231,0.3);
}
.btn::before { content:''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent, rgba(255,255,255,0.08)); opacity: 0; transition: opacity 0.3s; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(108,92,231,0.45); }
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled::before { display: none; }

.btn .btn-text { transition: opacity 0.2s; }
.btn .loader {
    display: none; width: 22px; height: 22px; 
    border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; 
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite;
}
.btn.loading { pointer-events: none; }
.btn.loading .btn-text { opacity: 0; }
.btn.loading .loader { display: block; }

@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }

/* FIX: Back Button Update (Horizontal Outline Secondary Button) */
.btn-cancel { 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; 
    padding: 16px; 
    background: transparent; 
    color: var(--text-dim); 
    border: 1.5px solid var(--border); 
    border-radius: var(--radius-sm); 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 1rem; 
    font-family: 'Outfit', sans-serif; 
    margin-top: 14px; 
    transition: all 0.3s cubic-bezier(0.23,1,0.32,1); 
    gap: 8px;
}
.btn-cancel:hover { 
    background: rgba(255, 255, 255, 0.05); 
    color: var(--text);
    border-color: var(--border-hover); 
    transform: translateY(-2px); 
}
.btn-cancel:active {
    transform: translateY(0);
}

/* Vouchers System */
.voucher-section { margin-top: 8px; }
.voucher-card {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface-2); padding: 16px 20px; border-radius: var(--radius-sm);
    margin-bottom: 12px; border: 1px solid var(--border);
    transition: all 0.3s; animation: cardPop 0.4s cubic-bezier(0.23,1,0.32,1) both;
}
.voucher-card:nth-child(1) { animation-delay: 0.1s; }
.voucher-card:nth-child(2) { animation-delay: 0.2s; }
@keyframes cardPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.voucher-card:hover { border-color: var(--border-hover); box-shadow: var(--glow); }
.voucher-code { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.05rem; color: var(--accent); letter-spacing: 0.04em; user-select: all; }
.copy-btn {
    background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border);
    padding: 8px 16px; border-radius: var(--radius-xs); cursor: pointer;
    font-weight: 600; font-size: 0.85rem; font-family: 'Outfit', sans-serif; transition: all 0.2s;
}
.copy-btn:hover { background: var(--success); color: white; border-color: var(--success); }

/* Footer Link */
.form-footer { margin-top: 36px; text-align: center; font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.03em; }

/* Dynamic Message Boxes */
.message { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 24px; font-weight: 500; font-size: 0.95rem; border: 1px solid transparent; }
.message.success { background: var(--success-bg); color: var(--success); border-color: rgba(0,184,148,0.3); }
.message.error { background: var(--error-bg); color: var(--error); border-color: rgba(255,107,107,0.3); }
.message.info { background: var(--info-bg); color: var(--info); border-color: rgba(116,185,255,0.3); }

/* Responsive Design */
@media (max-width: 992px) {
    .main-container { flex-direction: column; }
    .info-pane { display: none; }
    .form-pane { padding: 40px 24px; min-height: 100vh; }
    .form-header { text-align: center; }
    .form-header .telegram-btn { justify-content: center; }
    .stock-indicator { justify-content: center; }
    .otp-input-group input { width: 64px; height: 68px; font-size: 1.4rem; }
}