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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Контейнер */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка */
.auth-header {
    background: linear-gradient(135deg, #1bbd51 0%, #30ad68 100%);
    color: white;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(27, 189, 81, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.auth-logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.auth-header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.auth-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Бургер меню */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    width: 28px;
    height: 28px;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1bbd51 0%, #30ad68 100%);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(27, 189, 81, 0.15);
    z-index: 100;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Основное содержимое */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #F8F8F8;
}

/* Форма авторизации */
.auth-form-container {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.auth-form-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.auth-form-subtitle {
    font-size: 14px;
    color: #999;
    text-align: center;
    margin-bottom: 32px;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.auth-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.auth-form-input:focus {
    outline: none;
    border-color: #1bbd51;
    box-shadow: 0 0 0 3px rgba(27, 189, 81, 0.1);
}

.auth-form-input::placeholder {
    color: #bbb;
}

.auth-form-error {
    color: #e00004;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.auth-form-success {
    background: #d4f4e6;
    border: 1px solid #1bbd51;
    color: #1bbd51;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Чекбокс */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

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

.auth-checkbox a {
    color: #1bbd51;
    text-decoration: none;
}

.auth-checkbox a:hover {
    text-decoration: underline;
}

/* Кнопки */
.auth-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #1bbd51 0%, #30ad68 100%);
    color: white;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 189, 81, 0.3);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-secondary {
    background: #f5f7fa;
    color: #333;
    border: 1px solid #ddd;
    margin-top: 12px;
}

.auth-btn-secondary:hover {
    background: #eee;
}

/* Разделитель */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #ccc;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

/* Текст и ссылки */
.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 24px;
}

.auth-footer-text a {
    color: #1bbd51;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

.auth-forgot-link {
    font-size: 13px;
    color: #1bbd51;
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

/* Двойной ввод пароля */
.auth-password-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.auth-password-toggle:hover {
    color: #1bbd51;
}

.auth-form-input.password-input {
    padding-right: 44px;
}

/* Сообщения */
.auth-message {
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-message-info {
    background: #d1e7ff;
    border: 1px solid #0066cc;
    color: #0066cc;
}

.auth-message-warning {
    background: #fff3cd;
    border: 1px solid #f39c12;
    color: #f39c12;
}

.auth-message-error {
    background: #ffe0e0;
    border: 1px solid #e00004;
    color: #e00004;
}

/* Счётчик времени */
.auth-countdown {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin-top: 12px;
}

.auth-countdown strong {
    color: #1bbd51;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }

    .auth-header-actions {
        display: none;
    }

    .auth-form-container {
        padding: 32px 20px;
        border-radius: 8px;
    }

    .auth-form-title {
        font-size: 24px;
    }

    .auth-main {
        padding: 16px;
        min-height: calc(100vh - 56px);
    }

    .auth-form-input {
        padding: 14px 14px;
        font-size: 16px;
    }

    .auth-form-group {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .auth-header {
        padding: 12px 16px;
    }

    .auth-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .auth-logo {
        gap: 10px;
        font-size: 16px;
    }

    .auth-form-container {
        padding: 24px 16px;
    }

    .auth-form-title {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .auth-form-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .auth-main {
        padding: 12px;
    }

    .auth-divider {
        margin: 16px 0;
    }

    .auth-footer-text {
        font-size: 13px;
    }
}

/* Ссылка на соглашение */
.agreement-link {
    color: #1bbd51;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.3s ease;
}

.agreement-link:hover {
    color: #159f42;
    text-decoration: none;
}

/* Модальное окно */
.modal-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-window {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-window {
    animation: none;
}

.modal-overlay.active .modal-window {
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 30px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body iframe {
    display: block;
    min-height: 600px;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-window {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .modal-header {
        padding: 16px 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .modal-window {
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-header {
        padding: 14px 16px;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
}

/* Для более крупных экранов */
@media (min-width: 1200px) {
    .modal-window {
        max-width: 1000px;
    }
    
    .modal-body {
        padding: 40px 32px;
    }
}

/* Для более крупных экранов */
@media (min-width: 1200px) {
    .auth-form-container {
        padding: 48px 40px;
    }

    .auth-form-title {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .auth-form-subtitle {
        font-size: 15px;
        margin-bottom: 40px;
    }
}

/* SMS регистрация специфические стили */
.pin-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.pin-input {
    width: 48px;
    height: 48px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: monospace;
}

.pin-input:focus {
    outline: none;
    border-color: #1bbd51;
    box-shadow: 0 0 0 3px rgba(27, 189, 81, 0.1);
}

.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-input[type=number] {
    -moz-appearance: textfield;
}

@media (max-width: 480px) {
    .pin-input {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .pin-input-container {
        gap: 6px;
    }
}

/* 404 Error Page Styles */
.error-404 {
    background: var(--color-white);
    border-radius: 20px;
    width: 100%;
    max-width: 1620px;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.error-404__content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    max-width: 567px;
    width: 100%;
    padding: 40px;
}

.error-404__number {
    color: var(--color-success);
    text-align: center;
    font-family: var(--font-family-medium);
    font-size: 300px;
    line-height: 100%;
    font-weight: 500;
    width: 100%;
}

.error-404__container {
    display: flex;
    flex-direction: column;
    gap: 42px;
    align-items: center;
    width: 100%;
}

.error-404__title {
    color: var(--color-text-primary);
    text-align: center;
    font-family: var(--font-family-regular);
    font-size: 40px;
    font-weight: 400;
    width: 100%;
}

.error-404__btn {
    background: var(--color-success);
    border-radius: 100px;
    padding: 10px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--color-white);
    font-family: var(--font-family-medium);
    font-size: 24px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-404__btn:hover {
    background: #159F42;
}

/* Mobile 404 Styles */
@media (max-width: 768px) {
    .error-404 {
        border-radius: 30px;
        min-height: auto;
    }

    .error-404__content {
        gap: 12px;
        max-width: 358px;
        padding: 24px 16px;
    }

    .error-404__number {
        font-size: 160px;
    }

    .error-404__container {
        gap: 24px;
    }

    .error-404__title {
        font-size: 32px;
    }

    .error-404__btn {
        font-size: 16px;
    }
}
