body {
    background-color: #121212; /* Черный */
    color: #fff; /* Белый */
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #333; /* Темно-серый */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    width: 350px;
    max-width: 90vw;
    position: relative; /* Для абсолютного позиционирования кнопки Назад */
}

h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #fff;
}

input[type="email"],
input[type="password"],
input[type="submit"],
input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    background-color: #444; /* Темно-серый */
    color: #fff; /* Белый */
    box-sizing: border-box;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"] {
    border: 2px solid #555;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus {
    border-color: #8F00FF;
    outline: none;
}

#password,
#confirm_password {
    padding-right: 40px;
}

input[type="submit"] {
    background-color: #8F00FF; /* Фиолетовый */
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    border: none;
    transition: background-color 0.3s;
}

input[type="submit"]:hover {
    background-color: #a200ff; /* Более светлый фиолетовый при наведении */
}

input[type="date"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

text {
    color: #777;
    font-size: 14px;
    margin-top: 15px;
    display: block;
}

text2 {
    display: block;
    text-align: center;
    margin-top: 20px;
}

text2 a {
    cursor: pointer;
    text-decoration: none;
    color: #a200ff;
    font-weight: bold;
    transition: color 0.3s;
}

text2 a:hover {
    color: #c266ff;
    text-decoration: underline;
}

/* Стили для кнопки "Назад" в регистрации */
.back-link {
    position: absolute;
    top: 20px; /* Выносим кнопку за пределы контейнера */
    left: 20px;
    margin: 0;
}

.back-link a {
    color: #8F00FF;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.back-link a:hover {
    color: #a200ff;
    text-decoration: underline;
}

/* Стили для ошибок */
.error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    min-height: 18px;
}

/* Стили для подсказки пароля */
.password-hint {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    background: #2a2a2a;
    font-size: 13px;
    border: 1px solid #444;
}

.password-hint p {
    margin-top: 0;
    color: #aaa;
}

.password-hint ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #ccc;
}

.password-hint li {
    margin: 5px 0;
    transition: color 0.3s;
}

/* Стили для иконки показа пароля */
.password-container {
    position: relative;
    width: 100%;
}

.password-control {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    cursor: pointer;
    background: #777 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="white"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>') no-repeat center;
    background-size: 21px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.password-control:hover {
    background-color: #8F00FF;
}

.password-control.view {
    background: #8F00FF url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="white"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>') no-repeat center;
    background-size: 21px;
}

/* Индикатор сложности пароля */
.strength-meter {
    height: 5px;
    margin: 10px 0;
    background: #444;
    border-radius: 3px;
    overflow: hidden;
}

.strength-meter div {
    height: 100%;
    width: 0;
    transition: width 0.3s, background-color 0.3s;
}

.strength-meter .weak {
    background: #ff4d4d;
}

.strength-meter .medium {
    background: #ffa500;
}

.strength-meter .strong {
    background: #4CAF50;
}

/* Стили для капчи */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 5px;
    border: 1px solid #444;
}

.captcha-code {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 5px;
    background: #444;
    padding: 10px 15px;
    border-radius: 5px;
    user-select: none;
    color: #fff;
    flex-grow: 1;
    text-align: center;
}

.refresh-captcha {
    cursor: pointer;
    color: #8F00FF;
    font-size: 20px;
    padding: 5px;
    transition: color 0.3s;
}

.refresh-captcha:hover {
    color: #a200ff;
}

/* Стили для подтверждения данных */
.user-data {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #444;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #444;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: bold;
    color: #aaa;
}

.data-value {
    color: #fff;
}

.buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    flex: 1;
    padding: 12px 0px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-edit {
    background: #555;
    color: white;
}

.btn-edit:hover {
    background: #666;
}

.btn-confirm {
    background: #8F00FF;
    color: white;
}

.btn-confirm:hover {
    background: #a200ff;
}

/* Стили для ввода кода подтверждения */
.code-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
}

.code-input {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    border: 2px solid #555;
    border-radius: 5px;
    background: #444;
    color: white;
    transition: border-color 0.3s;
}

.code-input:focus {
    border-color: #8F00FF;
    outline: none;
}

.timer {
    margin: 15px 0;
    color: #aaa;
    text-align: center;
    font-size: 14px;
}

.resend-link {
    color: #8F00FF;
    cursor: pointer;
    text-align: center;
    display: block;
    margin-top: 15px;
    font-size: 14px;
    transition: color 0.3s;
}

.resend-link:hover {
    color: #a200ff;
    text-decoration: underline;
}

.resend-link.disabled {
    color: #666;
    cursor: not-allowed;
}

.resend-link.disabled:hover {
    color: #666;
    text-decoration: none;
}

/* Адаптивность */
@media (max-width: 400px) {
    .container {
        padding: 20px;
        width: 90vw;
        margin-top: 30px; /* Для кнопки Назад */
    }
    
    .code-input {
        width: 40px;
        height: 50px;
        font-size: 20px;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .back-link {
        top: -35px;
        font-size: 13px;
    }
}

/* Валидационные сообщения */
input:invalid {
    border-color: #ff6b6b;
}

input:valid {
    border-color: #4CAF50;
}

/* Дополнительные стили */
p {
    color: #ccc;
    text-align: center;
    line-height: 1.5;
    margin: 15px 0;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
    text-decoration: none;
    color: #a200ff;
    font-weight: bold;
    transition: color 0.3s;
    font-size: 14px;
}

.back-link:hover {
    color: #c266ff;
    text-decoration: underline;
}



.validation-message {
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
}
.valid {
    color: #4CAF50;
}
.invalid {
    color: #ff6b6b;
}
.loading {
    color: #aaa;
}
.email-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}
.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}
.status-icon.available {
    background-color: #4CAF50;
}
.status-icon.taken {
    background-color: #ff6b6b;
}
.status-icon.checking {
    background-color: #ffa500;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}