/* =============================================
   ClubKeyBot — Design System
   ============================================= */

/* ── Variables ────────────────────────────── */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B85FF;
    --secondary: #FF6584;
    --accent: #00D2A0;
    --dark: #1E1E2E;
    --dark-card: #282840;
    --dark-bg: #16162A;
    --gray-100: #F7F7FC;
    --gray-200: #E8E8F0;
    --gray-300: #C4C4D4;
    --gray-400: #9A9AB0;
    --gray-500: #6E6E8A;
    --gradient-hero: linear-gradient(135deg, #6C63FF 0%, #FF6584 50%, #00D2A0 100%);
    --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #5A52D5 100%);
    --gradient-card: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.1);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Base ─────────────────────────────────── */
body {
    font-family: var(--font-sans);
    background: var(--gray-100);
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ───────────────────────────────── */
.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}

.navbar-dark-custom {
    background: var(--dark) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
}

.navbar-brand .brand-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 8px;
    text-align: center;
    line-height: 32px;
    font-size: 1rem;
    margin-right: 8px;
    vertical-align: middle;
}

/* ── Buttons ──────────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #00D2A0 0%, #00B87A 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 210, 160, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 210, 160, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.btn-lg {
    border-radius: var(--radius-md);
    padding: 14px 32px;
}

.btn-sm {
    border-radius: 6px;
}

/* ── Cards ────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* ── Plan cards ───────────────────────────── */
.plan-card {
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plan-card.featured {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(108, 99, 255, 0.04) 0%, transparent 100%);
}

.plan-card.featured::before {
    content: '★ Популярный';
    position: absolute;
    top: 12px;
    right: -28px;
    background: var(--gradient-card);
    color: white;
    padding: 4px 32px;
    font-size: 0.7rem;
    font-weight: 600;
    transform: rotate(45deg);
    letter-spacing: 0.5px;
}

.plan-card .price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.plan-card .price-period {
    font-size: 0.9rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* ── Step indicator ───────────────────────── */
.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.step.pending {
    background: var(--gray-200);
    color: var(--gray-400);
}

.step.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
    transform: scale(1.1);
}

.step.completed {
    background: var(--accent);
    color: white;
}

.step-line {
    width: 80px;
    height: 3px;
    background: var(--gray-200);
    transition: all 0.4s ease;
    border-radius: 2px;
}

.step-line.completed {
    background: var(--accent);
}

/* ── Hero ─────────────────────────────────── */
.hero-section {
    background: var(--gradient-hero);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 100px;
    background: var(--gray-100);
    clip-path: ellipse(70% 100% at 50% 100%);
}

.hero-section h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-section .lead {
    opacity: 0.9;
    font-size: 1.15rem;
}

/* ── Stats cards ──────────────────────────── */
.stat-card {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* ── Alert messages ───────────────────────── */
.alert {
    border: none;
    border-radius: var(--radius-sm);
}

.alert-success {
    background: #E8FBF4;
    color: #00A06E;
}

.alert-info {
    background: #EEECFF;
    color: var(--primary-dark);
}

.alert-danger {
    background: #FFE8EC;
    color: #D6304A;
}

.alert-warning {
    background: #FFF3E0;
    color: #CC7A00;
}

/* ── Code display ─────────────────────────── */
.code-display {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--dark);
    color: #E8E8F0;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    user-select: all;
    cursor: pointer;
    transition: background 0.2s;
}

.code-display:hover {
    background: #2A2A42;
}

/* ── Feature icon ─────────────────────────── */
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(255, 101, 132, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

/* ── TeleWidget ───────────────────────────── */
.telegram-login-widget iframe {
    width: 200px !important;
}

/* ── TG Avatar ────────────────────────────── */
.tg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.tg-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Auth pages ───────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16162A 0%, #1E1E2E 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow-lg);
}

.auth-card h2 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ── Toast / notifications ────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

/* ── Animations ───────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-up-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* ── Chat list ────────────────────────────── */
.chat-item {
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

/* ── Responsive tweaks ────────────────────── */
@media (max-width: 768px) {
    .hero-section { padding: 60px 0; }
    .hero-section h1 { font-size: 2rem; }
    .plan-card .price-amount { font-size: 2rem; }
    .step-line { width: 40px; }
    .auth-card { margin: 1rem; }
}

/* Hide number input spinners (стрелки вверх/вниз) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
