:root {
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --border: #e2e8f0;
    --success: #10b981;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 414px;
    height: 100vh;
    max-height: 896px;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.header {
    background: var(--card-bg);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    padding: 2px;
}

.user-info { display: flex; flex-direction: column; }
.greeting { font-size: 12px; color: var(--text-muted); }
.user-name { font-size: 16px; color: var(--text-main); font-weight: 600; }

.lang-switcher { background: var(--bg-color); border-radius: 20px; padding: 4px; display: flex; }
.lang-btn {
    border: none; background: transparent; padding: 6px 12px; font-size: 12px; font-weight: 600;
    color: var(--text-muted); border-radius: 16px; cursor: pointer; transition: var(--transition);
}
.lang-btn.active { background: var(--card-bg); color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.screen {
    flex: 1; display: none; flex-direction: column; overflow-y: auto;
    background: var(--bg-color); padding: 20px; animation: fadeIn 0.3s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title { font-size: 24px; color: var(--text-main); margin: 24px 0; }
.section-title { font-size: 18px; color: var(--text-main); margin-bottom: 16px; font-weight: 700; }

/* Status Card */
.status-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 20px;
    padding: 20px;
    color: white;
    margin-bottom: 32px;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.status-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.status-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-date { font-size: 12px; opacity: 0.9; }
.status-body h4 { font-size: 18px; margin-bottom: 8px; }
.status-body p { font-size: 13px; opacity: 0.9; }

/* Service Cards */
.services-list { display: flex; flex-direction: column; gap: 16px; }
.service-card {
    background: var(--card-bg); border-radius: 16px; padding: 20px;
    display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); transition: var(--transition);
}
.service-card.active-card { cursor: pointer; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.service-card.active-card:active { transform: scale(0.98); }
.service-card.disabled { opacity: 0.6; background: transparent; }
.service-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.service-icon svg { width: 24px; height: 24px; }
.blue-icon { background: #eff6ff; color: var(--primary); }
.gray-icon { background: #f1f5f9; color: var(--text-muted); }
.service-details { flex: 1; }
.service-details h3 { font-size: 16px; color: var(--text-main); margin-bottom: 4px; }
.service-details p { font-size: 13px; color: var(--text-muted); }
.chevron svg { width: 20px; height: 20px; color: #cbd5e1; }

/* Quiz */
.sticky-quiz-header {
    position: sticky;
    top: -20px;
    background: var(--bg-color);
    z-index: 5;
    padding: 20px 20px 8px;
    margin: -20px -20px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.progress-container { background: var(--card-bg); padding: 12px 16px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
.progress-bar { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.4s ease; }

.quiz-content { flex: 1; display: flex; flex-direction: column; }
.quiz-step { display: none; flex-direction: column; flex: 1; animation: fadeIn 0.3s ease; }
.quiz-step.active { display: flex; }
.quiz-step h3 { font-size: 20px; color: var(--text-main); margin-bottom: 20px; }
.step-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--text-main); margin-bottom: 8px; }
.form-group input, .custom-select {
    width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
    font-size: 16px; transition: var(--transition); background: var(--card-bg); outline: none;
}
.custom-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 20px; }

.btn-group { display: flex; gap: 12px; margin-top: auto; padding-top: 24px; }
.btn-primary, .btn-secondary { padding: 14px 20px; border-radius: 12px; font-size: 16px; font-weight: 600; border: none; cursor: pointer; transition: var(--transition); text-align: center; width: 100%; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:active:not(:disabled) { background: var(--primary-hover); transform: scale(0.98); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.btn-secondary { background: #f1f5f9; color: var(--text-main); }

/* Options */
.options-group { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.checkbox-container {
    display: flex; align-items: center; position: relative; padding-left: 35px; cursor: pointer;
    font-size: 14px; font-weight: 500; color: var(--text-main); user-select: none;
}
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { position: absolute; top: -2px; left: 0; height: 24px; width: 24px; background-color: #eee; border-radius: 6px; transition: 0.2s; }
.checkbox-container:hover input ~ .checkmark { background-color: #ccc; }
.checkbox-container input:checked ~ .checkmark { background-color: var(--primary); }
.checkmark:after { content: ""; position: absolute; display: none; left: 9px; top: 5px; width: 6px; height: 12px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkbox-container input:checked ~ .checkmark:after { display: block; }

.upload-area { border: 2px dashed #cbd5e1; border-radius: 16px; padding: 30px 20px; text-align: center; background: #f8fafc; cursor: pointer; margin-bottom: 20px; }
.upload-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--text-muted); }
.upload-icon svg { width: 100%; height: 100%; }

.hidden { display: none !important; }
.verification-loader, .verification-success { display: flex; flex-direction: column; align-items: center; padding: 20px; background: var(--card-bg); border-radius: 16px; margin-bottom: 20px; }
.spinner { width: 30px; height: 30px; border: 3px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-icon { width: 48px; height: 48px; border-radius: 50%; background: #d1fae5; color: var(--success); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.success-icon svg { width: 24px; height: 24px; }

.success-animation { width: 80px; height: 80px; border-radius: 50%; background: var(--success); color: white; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.success-animation svg { width: 40px; height: 40px; }
@keyframes scaleIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.mt-auto { margin-top: auto; }
.mt-large { margin-top: 40px; }
.text-center { text-align: center; }

.debug-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    border-top: 1px dashed var(--border);
}

.btn-debug {
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-debug:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--card-bg);
    padding: 8px 16px 12px; /* Сделал компактнее */
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 10;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-item svg { width: 22px; height: 22px; } /* Уменьшил иконки */
.nav-item.active { color: var(--primary); }

/* PWA Install Banner */
.install-banner {
    position: absolute;
    bottom: 80px; /* Выше bottom-nav */
    left: 16px;
    right: 16px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 20;
    border: 1px solid var(--primary);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.install-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.install-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; }
.install-text { display: flex; flex-direction: column; }
.install-text strong { font-size: 14px; color: var(--text-main); margin-bottom: 4px; }
.install-text span { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.install-btn { padding: 8px 16px; font-size: 13px; width: auto; margin-left: 12px; flex-shrink: 0; white-space: nowrap; }
.btn-close-banner { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px; margin-left: 8px; flex-shrink: 0; }
