/* ОСНОВНЫЕ СТИЛИ */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f9f8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    width: 100%;
    background: #fff; 
    border-radius: 10px;
    padding: 20px 40px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    color: #2c7a7b;
}

.info {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

footer {
    text-align: center;
    font-size: 14px;
    color: #444;
    margin-top: 20px;
}

/* СТИЛИ ДЛЯ ФОРМЫ АВТОРИЗАЦИИ (index.html) */
.login-box {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #444;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-box label {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.login-box input:focus {
    border-color: #2c7a7b;
    outline: none;
}

.login-box .checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-box .checkbox label {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: normal;
}

.login-box .buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.login-box .buttons button {
    background: #2c7a7b;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.login-box .buttons button:hover {
    background: #225e5f;
}

.login-box .buttons a {
    text-decoration: none;
    color: #2c7a7b;
    font-size: 14px;
}

.login-box .buttons a:hover {
    text-decoration: underline;
}

/* СТИЛИ ДЛЯ ФОРМЫ РЕГИСТРАЦИИ (registr.html) */
.registration-box {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.registration-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #444;
}

.registration-box form {
    display: flex;
    flex-direction: column;
}

.registration-box label {
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
    display: block;
}

.registration-box input[type="text"],
.registration-box input[type="email"],
.registration-box input[type="password"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
}

.registration-box .hint {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 2px;
    margin-bottom: 15px;
}

/* Фокус для полей регистрации */
.registration-box input:focus {
    border-color: #2c7a7b;
    outline: none;
}

/* СТИЛИ ВАЛИДАЦИИ С ИКОНКАМИ */
.fa-check {
    color: #27ae60;
    margin-left: 8px;
}

.fa-times {
    color: #e74c3c;
    margin-left: 8px;
}

/* Скрываем все иконки по умолчанию */
#valid_first_name, #invalid_first_name,
#valid_last_name, #invalid_last_name,
#valid_phone, #invalid_phone,

#valid_password, #invalid_password,
#valid_confirm_password, #invalid_confirm_password {
    display: none;
}

/* Показываем check когда поле валидно */
#first_name:valid ~ #valid_first_name,
#last_name:valid ~ #valid_last_name,
#phone:valid ~ #valid_phone,

#password:valid ~ #valid_password,
#confirm_password:valid ~ #valid_confirm_password {
    display: inline-block;
}

/* Показываем times когда поле невалидно */
#first_name:invalid:not(:placeholder-shown) ~ #invalid_first_name,
#last_name:invalid:not(:placeholder-shown) ~ #invalid_last_name,
#phone:invalid:not(:placeholder-shown) ~ #invalid_phone,

#password:invalid:not(:placeholder-shown) ~ #invalid_password,
#confirm_password:invalid:not(:placeholder-shown) ~ #invalid_confirm_password {
    display: inline-block;
}

/* Скрываем check когда показываем times */
#first_name:invalid:not(:placeholder-shown) ~ #valid_first_name,
#last_name:invalid:not(:placeholder-shown) ~ #valid_last_name,
#phone:invalid:not(:placeholder-shown) ~ #valid_phone,

#password:invalid:not(:placeholder-shown) ~ #valid_password,
#confirm_password:invalid:not(:placeholder-shown) ~ #valid_confirm_password {
    display: none;
}

/* КНОПКИ ДЛЯ РЕГИСТРАЦИИ */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

input[type="submit"],
input[type="reset"] {
    background: #2c7a7b;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    min-width: 160px;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover,
input[type="reset"]:hover {
    background: #225e5f;
}

/* ССЫЛКА ДЛЯ ВХОДА */
.login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.login-link p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.login-link a {
    color: #2c7a7b;
    text-decoration: none;
    font-weight: bold;
}

.login-link a:hover {
    text-decoration: underline;
}

/* СТИЛИ ДЛЯ ДАННЫХ ПОЛЬЗОВАТЕЛЯ */
.user-data {
    width: 100%;
    border-collapse: collapse;
}

.user-data tr {
    border-bottom: 1px solid #eee;
}

.user-data td {
    padding: 12px 8px;
}

.user-data .col1 {
    width: 120px;
    font-weight: bold;
    color: #2c7a7b;
}

.error {
    color: #e74c3c;
    font-weight: bold;
}

.success {
    color: #27ae60;
    font-weight: bold;
}

/* АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ */
@media (max-width: 600px) {
    .container {
        padding: 15px 20px;
        margin: 10px;
    }
    
    .login-box,
    .registration-box {
        padding: 15px;
    }
    
    .login-box .buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .login-box .buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .login-box .buttons a {
        text-align: center;
        width: 100%;
        display: block;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    input[type="submit"],
    input[type="reset"] {
        width: 100%;
        min-width: auto;
    }
}

/* Стили для полей ввода в форме авторизации */
.login-box input[type="email"],
.login-box input[type="password"] {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.login-box input:focus {
    border-color: #2c7a7b;
    outline: none;
}

/* Общий класс для полей ввода */
.form-input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.form-input:focus {
    border-color: #2c7a7b;
    outline: none;
}