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

:root {
    --primary-color: #007AFF;
    --primary-hover: #0056b3;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --background: #f5f5f5;
    --white: #ffffff;
    --ring-bg: #e0e0e0;
    --ring-fill: #007AFF;
    --success-color: #34C759;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    color: var(--text-color);
    overflow-x: hidden;
}

.auth-container {
    width: 100%;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: var(--white);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.subtitle {
    color: var(--text-light);
    font-size: 16px;
}

.auth-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-step.active {
    display: block;
    opacity: 1;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.phone-prefix {
    padding: 16px 8px 16px 16px;
    background: var(--background);
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
}

.phone-input {
    flex: 1;
    padding: 16px 16px 16px 8px;
    border: none;
    background: var(--background);
    font-size: 16px;
    outline: none;
    width: 100%;
    color: var(--text-color);
}

.phone-input::placeholder,
.code-input::placeholder {
    color: #999;
    opacity: 0.8;
}

.input-hint {
    font-size: 12px;
    color: var(--text-light);
}

.btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-primary:not(:disabled):hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 8px;
    font-size: 14px;
}

.btn-link:disabled {
    color: #999;
    cursor: not-allowed;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    cursor: pointer;
    margin-bottom: 20px;
    padding: 8px 0;
    font-size: 14px;
}

.phone-display {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 16px;
}

.code-input-container {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin: 16px 0;
}

.code-input {
    width: 60px;
    height: 60px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    outline: none;
    background: var(--background);
    color: var(--text-color);
}

@media (max-width: 380px) {
    .code-input {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

.code-input:focus {
    border-color: var(--primary-color);
}

.timer-block {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin: 8px 0;
}

#timer {
    font-weight: 600;
    color: var(--primary-color);
}

/* ========== СТРАНИЦА ПРИВЕТСТВИЯ ========== */
.welcome-container {
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Фоновая картинка на всю карточку */
.welcome-card {
    width: 100%;
    min-height: 100vh;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    
    /* Фоновое изображение */
    background-image: url('test.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Полупрозрачный слой для читаемости текста - СДЕЛАЛ СВЕТЛЕЕ */
.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3); /* было 0.85, стало 0.92 - светлее */
    z-index: 0;
}

/* Все содержимое карточки должно быть поверх затемнения */
.employee-name,
.categories-indicator,
.current-category-name,
.progress-ring-container,
.stats-container {
    position: relative;
    z-index: 1;
}

/* Имя сотрудника */
.employee-name-text {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Индикаторы категорий (точки) */
.categories-indicator {
    margin-bottom: 20px;
}

.category-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-dot.active {
    width: 28px;
    border-radius: 5px;
    background: var(--primary-color);
}

/* Название текущей категории */
.current-category-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    text-align: center;
}

/* Контейнер для кольца прогресса */
.progress-ring-container {
    display: flex;
    justify-content: center;
    margin: 16px 0 40px;
    position: relative;
}

.progress-ring {
    width: 260px;
    height: 260px;
}

.progress-ring-circle-bg {
    stroke: var(--ring-bg);
    stroke-width: 14;
    fill: none;
}

.progress-ring-circle {
    stroke: var(--ring-fill);
    stroke-width: 14;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
    transform: rotate(-90deg);
    transform-origin: 130px 130px;
}

.progress-ring-text {
    font-size: 40px;
    font-weight: 800;
    fill: var(--text-color);
    dominant-baseline: middle;
    text-anchor: middle;
}

.ring-percent {
    font-size: 56px;
    font-weight: 900;
}

.ring-percent-sign {
    font-size: 28px;
}

/* Статистика */
.stats-container {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.data-row {
    font-size: 20px;
    margin: 16px 0;
    color: var(--text-color);
}

.data-row strong {
    color: var(--primary-color);
    font-size: 26px;
}

/* Спиннер загрузки */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--ring-bg);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1c1c1e;
        --white: #2c2c2e;
        --text-color: #ffffff;
        --text-light: #98989d;
        --border-color: #3a3a3c;
        --ring-bg: #3a3a3c;
        --ring-fill: #0A84FF;
    }

    .welcome-card::before {
        background: rgba(44, 44, 46, 0.9); /* тоже сделал светлее для темной темы */
    }

    .progress-ring-text {
        fill: #ffffff;
    }
}

/* Адаптация для планшетов */
@media (min-width: 768px) and (max-width: 1024px) {
    .progress-ring {
        width: 300px;
        height: 300px;
    }
    
    .progress-ring-circle-bg,
    .progress-ring-circle {
        stroke-width: 16;
    }
    
    .ring-percent {
        font-size: 64px;
    }
    
    .employee-name-text {
        font-size: 36px;
    }
    
    .current-category-name {
        font-size: 32px;
    }
    
    .data-row {
        font-size: 22px;
    }
    
    .data-row strong {
        font-size: 28px;
    }
}

/* Адаптация для маленьких телефонов */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px 16px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .btn {
        padding: 14px 20px;
    }

    .welcome-card {
        padding: 24px 16px;
    }
    
    .employee-name-text {
        font-size: 26px;
        margin-bottom: 16px;
    }
    
    .progress-ring {
        width: 220px;
        height: 220px;
    }
    
    .progress-ring-circle-bg,
    .progress-ring-circle {
        stroke-width: 12;
    }
    
    .ring-percent {
        font-size: 48px;
    }
    
    .ring-percent-sign {
        font-size: 24px;
    }
    
    .current-category-name {
        font-size: 22px;
        margin-bottom: 16px;
        min-height: 60px;
    }
    
    .data-row {
        font-size: 18px;
        margin: 12px 0;
    }
    
    .data-row strong {
        font-size: 22px;
    }
    
    .category-dot {
        width: 8px;
        height: 8px;
    }
    
    .category-dot.active {
        width: 24px;
    }
}

/* Для очень высоких экранов */
@media (min-height: 800px) {
    .welcome-card {
        justify-content: center;
    }
}