/* Стили для страницы регистрации пользователей */
.user-registration-page {
    padding: 20px 0;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.registration-header {
    text-align: center;
    margin-bottom: 40px;
}

.registration-header h1 {
    color: #121324;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.registration-header p {
    color: #6b7280;
    font-size: 16px;
}

.registration-form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.registration-form {
    max-width: 100%;
}

.form-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    color: #121324;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007cba;
    display: inline-block;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.form-group small {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.password-group {
    position: relative;
}

.password-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-start;
    width: 100%;
}

.password-buttons .btn {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Убеждаемся, что поля пароля одинаковой ширины */
.password-group input[type="password"],
.form-group input[type="password"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Стили для чекбокса одобрения */
.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #007cba;
    border-color: #007cba;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label:hover .checkmark {
    border-color: #007cba;
}

/* Стили для модального окна результата */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

.result-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.result-modal-header {
    background: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.result-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.result-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.result-modal-body {
    padding: 25px;
    max-height: 50vh;
    overflow-y: auto;
}

.result-modal-footer {
    background: #f8f9fa;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.success-content {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    line-height: 1.6;
}

.error-content {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    line-height: 1.6;
}

.success-content strong {
    color: #0c5460;
}

.error-content strong {
    color: #721c24;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f8f9fa;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #d1d5db;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

.registration-result {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.success-message {
    color: #27ae60;
}

.success-message h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.success-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.error-message {
    color: #e74c3c;
}

.error-message h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.error-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 768px) {
    .user-registration-page {
        padding: 15px 0;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .registration-header h1 {
        font-size: 22px;
    }
    
    .registration-form-container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-section {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .form-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
        padding: 12px;
    }
    
    .password-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .password-buttons .btn {
        width: 100%;
        padding: 10px 12px;
    }
    
    /* Адаптивность модального окна */
    .result-modal {
        padding: 10px;
    }
    
    .result-modal-content {
        max-width: 100%;
        max-height: 90vh;
    }
    
    .result-modal-header {
        padding: 15px 20px;
    }
    
    .result-modal-header h3 {
        font-size: 18px;
    }
    
    .result-modal-body {
        padding: 20px;
    }
    
    .result-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .result-modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .registration-form-container {
        padding: 15px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .registration-header h1 {
        font-size: 20px;
    }
    
    .registration-header p {
        font-size: 14px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.registration-form-container {
    animation: fadeIn 0.5s ease-out;
}

.registration-result {
    animation: fadeIn 0.3s ease-out;
}
