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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f0f0f;
    color: #e8e8e8;
    min-height: 100vh;
}

/* ШАПКА */
header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    color: #ff4444;
    letter-spacing: 1px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.balance {
    font-size: 14px;
    color: #aaa;
    background: #252525;
    padding: 6px 12px;
    border-radius: 20px;
}

/* КНОПКИ */
.btn-primary {
    background: #ff4444;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: #e03333; }
.btn-outline {
    background: transparent;
    color: #e8e8e8;
    border: 1px solid #444;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.btn-outline:hover { border-color: #888; }
.btn-large { padding: 14px 36px; font-size: 16px; }
.btn-full { width: 100%; margin-top: 8px; }
.btn-lang { padding: 6px 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }

/* HERO */
.hero {
    text-align: center;
    padding: 100px 24px;
    max-width: 700px;
    margin: 0 auto;
}
.hero h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}
.subtitle {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 36px;
    line-height: 1.5;
}
.hint { font-size: 13px; color: #666; margin-top: 12px; }

/* CONTAINER */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* КАРТОЧКИ */
.card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 28px;
}
.card h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* ФОРМА */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #aaa; margin-bottom: 6px; }
.form-group input, .form-group select {
    width: 100%;
    background: #252525;
    border: 1px solid #333;
    color: #e8e8e8;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: #ff4444; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ПРОГРЕСС */
.progress-bar {
    background: #252525;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin: 16px 0 8px;
}
.progress-fill {
    height: 100%;
    background: #ff4444;
    border-radius: 8px;
    transition: width 0.5s ease;
    width: 0%;
}
.progress-label { font-size: 14px; color: #aaa; }

/* РЕЗУЛЬТАТ */
.result-section { margin-bottom: 20px; }
.result-label {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.result-text {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.btn-copy {
    background: #333;
    color: #aaa;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.btn-copy:hover { background: #444; color: #fff; }

/* ОБЛОЖКИ */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}
.thumbnails-grid img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.thumbnails-grid img:hover { transform: scale(1.02); }

/* БАЛАНС */
.balance-card { }
.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.credits-info { font-size: 13px; color: #666; }
.topup-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #aaa; }
.btn-topup {
    background: #252525;
    color: #e8e8e8;
    border: 1px solid #333;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.btn-topup:hover { border-color: #ff4444; color: #ff4444; }

/* МОДАЛЬНОЕ ОКНО */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 420px;
    max-width: calc(100vw - 32px);
}
.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 36px;
    position: relative;
}
.modal-content h2 { font-size: 22px; margin-bottom: 24px; text-align: center; }
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
}

/* Google кнопка */
.btn-google {
    width: 100%;
    background: white;
    color: #333;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}
.btn-google:hover { background: #f5f5f5; }

.divider {
    text-align: center;
    color: #555;
    font-size: 13px;
    margin: 16px 0;
    position: relative;
}
.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: #333;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* Табы */
#auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #252525;
    padding: 4px;
    border-radius: 8px;
}
.tab {
    flex: 1;
    background: none;
    border: none;
    color: #aaa;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.tab.active { background: #333; color: #fff; }

.error-text { color: #ff6b6b; font-size: 13px; margin-top: 10px; text-align: center; }
.hidden { display: none !important; }

@media (max-width: 600px) {
    .hero h1 { font-size: 32px; }
    .form-row { grid-template-columns: 1fr; }
    .thumbnails-grid { grid-template-columns: 1fr; }
}
