* { 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 is now defined in landing styles in index.html */
.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; }
.source-tab { transition: background 0.2s, border-color 0.2s, color 0.2s; }
.source-tab.active { background: #ff4444; border-color: #ff4444; color: #fff; font-weight: 600; }
.source-tab.active:hover { border-color: #ff4444; }

.form-hint {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    margin-top: -4px;
}

@keyframes input-glow {
    0%, 100% { border-color: #333; box-shadow: none; }
    50% { border-color: #ff4444; box-shadow: 0 0 0 3px rgba(255,68,68,0.12); }
}
.input-highlight {
    animation: input-glow 2s ease-in-out 3;
}
.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 80px;
    max-width: 740px;
    margin: 0 auto;
}
.hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}
.subtitle {
    font-size: 17px;
    color: #888;
    margin-bottom: 32px;
    line-height: 1.65;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.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; }

/* HERO SEARCH */
.hero-search {
    display: flex;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto 14px;
}
.hero-search input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e8e8e8;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}
.hero-search input:focus { border-color: #ff4444; }
.hero-search-btn { padding: 14px 22px; white-space: nowrap; border-radius: 10px; }

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