/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    background-color: #ffffff;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Геометрический пиксельный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        /* Диагональные линии */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.03) 1px,
            rgba(0, 0, 0, 0.03) 2px
        ),
        /* Вертикальные линии */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 32px,
            rgba(0, 0, 0, 0.02) 32px,
            rgba(0, 0, 0, 0.02) 33px
        ),
        /* Горизонтальные линии */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 24px,
            rgba(0, 0, 0, 0.02) 24px,
            rgba(0, 0, 0, 0.02) 25px
        ),
        /* Ромбовидный паттерн */
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.01) 40px,
            rgba(0, 0, 0, 0.01) 41px
        );
    animation: geometric-shift 25s infinite linear;
    z-index: -2;
}

@keyframes geometric-shift {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(5px, -3px);
    }
    50% {
        transform: translate(-3px, 5px);
    }
    75% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* Пиксельные линии */
.pixel-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.05);
    height: 1px;
    animation: line-slide 12s infinite ease-in-out;
}

.pixel-line:nth-child(1) {
    width: 600px;
    top: 20%;
    left: -600px;
    animation-delay: 0s;
}

.pixel-line:nth-child(2) {
    width: 500px;
    top: 45%;
    right: -500px;
    animation-delay: 4s;
}

.pixel-line:nth-child(3) {
    width: 550px;
    bottom: 30%;
    left: -550px;
    animation-delay: 8s;
}

@keyframes line-slide {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.05;
    }
    90% {
        opacity: 0.05;
    }
    100% {
        transform: translateX(120vw);
        opacity: 0;
    }
}

/* Контейнер формы авторизации */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 20px;
}

.auth-form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 40px 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.auth-form-section {
    width: 100%;
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
    color: #000000;
    letter-spacing: -0.5px;
}

/* Форма */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Поля ввода */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.auth-label {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    letter-spacing: 0.2px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: #000000;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input:focus {
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.auth-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.auth-input--error,
.auth-input.auth_input--error {
    border-color: rgba(220, 38, 38, 0.5);
    background-color: rgba(220, 38, 38, 0.05);
}

.auth-input--error:focus,
.auth-input.auth_input--error:focus {
    border-color: rgba(220, 38, 38, 0.7);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.auth-input--valid,
.auth-input.auth_input--valid {
    border-color: rgba(34, 197, 94, 0.5);
    background-color: rgba(34, 197, 94, 0.05);
}

.auth-input--valid:focus,
.auth-input.auth_input--valid:focus {
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Обертка для поля пароля с кнопкой показа/скрытия */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper .auth-input {
    padding-right: 45px;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    color: rgba(0, 0, 0, 0.5);
    transition: color 0.2s ease;
    outline: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.auth-password-toggle:hover {
    color: rgba(0, 0, 0, 0.7);
}

.auth-password-toggle:active {
    transform: scale(0.95);
}

.auth-password-toggle:focus {
    color: rgba(0, 0, 0, 0.8);
}

.auth-password-toggle svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: none;
}

.auth-forgot-link {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
    text-decoration: none;
    margin-top: 4px;
    align-self: flex-start;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: rgba(0, 0, 0, 0.8);
    text-decoration: underline;
}

/* Чекбокс */
.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #000000;
}

.auth-checkbox-text {
    font-size: 14px;
    color: #000000;
    cursor: pointer;
}

/* Поле для сообщений */
.auth-message {
    min-height: 20px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 6px;
    display: none;
    word-wrap: break-word;
}

.auth-message.show {
    display: block;
}

.auth-message.error {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.auth-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Кнопки */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.auth-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    letter-spacing: 0.3px;
}

.auth-button--primary {
    background: #000000;
    color: #ffffff;
}

.auth-button--primary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-button--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.auth-button--primary:disabled {
    background: rgba(0, 0, 0, 0.4);
    cursor: not-allowed;
    transform: none;
}

.auth-button--secondary {
    background: #ffffff;
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.auth-button--secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
}

.auth-button--secondary:active {
    background: rgba(0, 0, 0, 0.08);
}

.auth-button--link {
    margin-top: 20px;
    background: transparent;
    color: #000000;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 10px;
}

.auth-button--link:hover {
    color: rgba(0, 0, 0, 0.7);
    text-decoration-thickness: 2px;
}

/* Адаптивность */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
        height: auto;
        min-height: 100vh;
    }
    
    .auth-container {
        padding: 0 16px;
    }
    
    .auth-form-wrapper {
        padding: 32px 24px;
    }
    
    .auth-title {
        font-size: 24px;
        margin-bottom: 28px;
    }
    
    .auth-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .auth-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Индикатор силы пароля */
.auth-password-strength {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-password-strength--weak {
    color: #dc3545;
}

.auth-password-strength--medium {
    color: #ffc107;
}

.auth-password-strength--strong {
    color: #28a745;
}

/* Секция повторной отправки кода */
.auth-resend {
    margin-top: 16px;
    text-align: center;
}

.auth-resend-timer {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

/* Прогресс-бар восстановления пароля */
.auth-progress {
    margin-bottom: 24px;
}

.auth-progress-text {
    display: block;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 8px;
    font-weight: 500;
}

.auth-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.auth-progress-fill {
    height: 100%;
    background-color: #000000;
    border-radius: 2px;
    transition: width 0.3s ease;
}

