/* ============================================================================
   GameNet License System - Dark Theme CSS
   Based on template.txt specifications
   ============================================================================ */

/* ============================================================================
   CSS Variables (Design Tokens)
   ============================================================================ */

:root {
    /* Backgrounds */
    --bg-main: #0B0F1A;
    --bg-surface: #111827;
    --bg-surface-2: #0F172A;
    --bg-glass: rgba(255, 255, 255, 0.04);

    /* Text */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Primary (Gaming Neon) */
    --primary: #00E5FF;
    --primary-soft: rgba(0, 229, 255, 0.15);
    --primary-glow: rgba(0, 229, 255, 0.35);

    /* Success */
    --success: #22C55E;
    --success-soft: rgba(34, 197, 94, 0.15);

    /* Reward / Premium */
    --reward: #8B5CF6;
    --reward-soft: rgba(139, 92, 246, 0.18);

    /* Danger */
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.15);

    /* Warning */
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.15);

    /* Borders */
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);

    /* Typography */
    --font-main: "IRANSansX", "Inter", sans-serif;
    --text-xl: 32px;
    --text-lg: 20px;
    --text-md: 16px;
    --text-sm: 13px;
    --text-xs: 11px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --transition-fast: 160ms ease-out;
    --transition-normal: 250ms ease-out;
}

/* ============================================================================
   Global Resets
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-main);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface-2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); font-weight: 600; }

p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
    background: var(--bg-surface);
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.card.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.card-title {
    font-size: var(--text-lg);
    margin-bottom: 4px;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: var(--text-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #00E5FF, #22D3EE);
    color: #001016;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-surface);
    border-color: var(--border-strong);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: white;
}

/* Block Button */
.btn-block {
    width: 100%;
}

/* Small Button */
.btn-sm {
    padding: 8px 16px;
    font-size: var(--text-sm);
}

/* ============================================================================
   Forms & Inputs
   ============================================================================ */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--text-md);
    font-family: var(--font-main);
    transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* ============================================================================
   Alerts
   ============================================================================ */

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-soft);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* ============================================================================
   Login Page
   ============================================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--primary-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.login-logo h1 {
    margin-bottom: 8px;
}

.login-logo p {
    font-size: var(--text-sm);
}

.login-form {
    margin-bottom: 24px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
}

.form-footer span {
    color: var(--text-secondary);
    margin-left: 8px;
}

.link {
    color: var(--primary);
    font-size: var(--text-sm);
}

/* Login Background */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none; /* Allow clicks to pass through */
}

.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -300px;
    right: -300px;
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 26, 0.9);
    backdrop-filter: blur(8px);
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    max-height: none;
    margin: auto;
    box-sizing: border-box;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }

    :root {
        --text-xl: 28px;
        --text-lg: 18px;
    }
}

/* Premium client polish */
body {
    background:
        radial-gradient(circle at 10% 12%, rgba(34, 211, 238, .12), transparent 30%),
        radial-gradient(circle at 88% 8%, rgba(245, 158, 11, .10), transparent 26%),
        linear-gradient(135deg, #050914 0%, #091323 52%, #05070d 100%);
}

.card,
.modal-content,
.login-card,
.summary-section,
.calculator-section {
    background: linear-gradient(135deg, rgba(8, 15, 28, .92), rgba(15, 23, 42, .82)) !important;
    border: 1px solid rgba(56, 189, 248, .18) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.04) !important;
    backdrop-filter: blur(18px);
}

.btn-primary,
.btn-purchase {
    background: linear-gradient(135deg, #f59e0b 0%, #fb923c 48%, #06b6d4 140%) !important;
    border: 1px solid rgba(251, 191, 36, .35) !important;
    box-shadow: 0 14px 36px rgba(245, 158, 11, .24), inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.btn-secondary,
.calc-input,
.payment-btn,
input,
select,
textarea {
    background: rgba(8, 15, 28, .72) !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #e5eefb !important;
}

.payment-btn.selected,
.plan-card.selected {
    border-color: rgba(34, 211, 238, .65) !important;
    box-shadow: 0 16px 46px rgba(34, 211, 238, .14), inset 0 0 36px rgba(34,211,238,.06) !important;
}
