* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f6f8f4;
    color: #2b3327;
}

/* Шапка */
header {
    background: linear-gradient(145deg, #eef3e9 0%, #e4ecdd 100%);
    padding: 50px 20px 40px;
    text-align: center;
    border-bottom: 1px solid #d3ddc9;
    position: relative;
}
header::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #7ea06a;
    border-radius: 4px;
}
header h1 {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #2f4a26;
}
header h1 span {
    font-weight: 500;
}
header p {
    margin-top: 12px;
    font-size: 16px;
    color: #4f5c47;
    background: rgba(255, 255, 255, 0.5);
    display: inline-block;
    padding: 4px 24px;
    border-radius: 40px;
}

/* Основной блок */
main {
    flex: 1;
    padding: 40px 20px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

/* Карточка входа */
.auth-block {
    background: #ffffff;
    padding: 36px 34px 30px;
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.02);
    border: 1px solid #e0e8d8;
}
.auth-block h3 {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #2f4a26;
    border-left: 4px solid #7ea06a;
    padding-left: 14px;
    margin-bottom: 24px;
}
.auth-block label {
    display: block;
    font-weight: 500;
    margin: 18px 0 6px 0;
    font-size: 14px;
    color: #4f5c47;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.auth-block input {
    padding: 12px 16px;
    width: 100%;
    border: 1px solid #d3ddc9;
    border-radius: 60px;
    font-size: 15px;
    background: #fafcf8;
    transition: 0.2s;
    outline: none;
}
.auth-block input:focus {
    border-color: #7ea06a;
    box-shadow: 0 0 0 3px rgba(126, 160, 106, 0.15);
    background: #ffffff;
}
.auth-block input::placeholder {
    color: #a9b8a0;
    font-weight: 300;
}
.auth-block input.error {
    border-color: #c0392b;
    background: #fdf2f0;
}
.auth-block input.error:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}
.auth-block input.success {
    border-color: #27ae60;
    background: #f0faf4;
}

/* Сообщения об ошибках */
.error-message {
    color: #c0392b;
    font-size: 13px;
    margin-top: 6px;
    padding-left: 16px;
    min-height: 20px;
}

/* Кнопки */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 14px 0;
}
.btn-group button {
    padding: 10px 28px;
    cursor: pointer;
    border-radius: 60px;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
    border: 1px solid #d3ddc9;
    background: #fafcf8;
    color: #2b3327;
    flex: 1 1 auto;
    min-width: 120px;
}
.btn-group button:first-child {
    background: #2f4a26;
    border-color: #2f4a26;
    color: white;
    box-shadow: 0 2px 8px rgba(47, 74, 38, 0.12);
}
.btn-group button:first-child:hover {
    background: #24391d;
    transform: scale(1.01);
}
.btn-group button:last-child {
    background: transparent;
}
.btn-group button:last-child:hover {
    background: #eef3e9;
    border-color: #7ea06a;
}

/* Доп. блок: ссылка + чекбокс */
.auth-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}
.auth-links a {
    color: #4f5c47;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px dashed #c2d1b8;
    transition: 0.15s;
    cursor: pointer;
}
.auth-links a:hover {
    color: #2f4a26;
    border-bottom: 1px solid #2f4a26;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #3a4433;
}
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2f4a26;
    cursor: pointer;
    flex-shrink: 0;
}

/* Профиль пользователя */
.user-profile {
    display: none;
    text-align: center;
    padding: 10px 0;
}
.user-profile.show {
    display: block;
}
.user-profile .user-name {
    font-size: 18px;
    font-weight: 500;
    color: #2f4a26;
    margin-bottom: 12px;
}
.user-profile .logout-btn {
    padding: 10px 30px;
    cursor: pointer;
    border-radius: 60px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #d3ddc9;
    background: #fafcf8;
    color: #2b3327;
    transition: 0.2s;
}
.user-profile .logout-btn:hover {
    background: #eef3e9;
    border-color: #7ea06a;
}

/* Скрытие формы */
.auth-form {
    display: block;
}
.auth-form.hidden {
    display: none;
}

/* Футер */
footer {
    background: #eef3e9;
    padding: 24px 20px;
    text-align: center;
    border-top: 1px solid #d3ddc9;
    margin-top: 20px;
    font-size: 14px;
    color: #4f5c47;
}
footer a {
    color: #2f4a26;
    text-decoration: none;
    border-bottom: 1px dotted #7ea06a;
}
footer a:hover {
    border-bottom: 1px solid #2f4a26;
}
.footer-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 30px;
    max-width: 500px;
    margin: 0 auto;
}
.footer-copy {
    margin-top: 14px;
    font-size: 13px;
    opacity: 0.7;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    header h1 { font-size: 24px; }
    .auth-block { padding: 24px 18px; }
    .btn-group button { min-width: 100%; }
    .auth-extra { flex-direction: column; align-items: stretch; }
}