/* Локальные шрифты: используем системные */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --brand-500: #0ea5e9;
    --brand-600: #0284c7;
    --brand-700: #0369a1;
    --dark-800: #1e293b;
    --dark-900: #0f172a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: #f8fafc;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden; /* Маскировка под одностраничное приложение */
}

/* Динамическая сетка на чистом CSS */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* Анимированное пятно (Blob) без внешних скриптов */
.blob {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0) 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: floatBlob 20s infinite alternate ease-in-out;
    z-index: 0;
    pointer-events: none;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20%, 10%) scale(1.2); }
}

/* Стили для формы */
.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9); /* Чуть плотнее фон */
    backdrop-filter: blur(12px);
    border-radius: 12px; /* Более мягкое скругление по оригиналу */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 440px; /* Увеличили ширину плитки */
    padding: 3rem 2.5rem 2.5rem 2.5rem; /* Больше отступов внутри */
    border-top: 4px solid #0ea5e9; /* Та самая синяя полоса наверху */
    overflow: hidden;
}

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

/* Фикс автозаполнения для скрытности */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #334155 !important;
}

.selection-bg-brand::selection {
    background: #bae6fd;
    color: #0c4a6e;
}

.login-card-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 0 1rem;
}

.top-gradient-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    h: 4px;
    background:
    linear-gradient(to right, #0ea5e9, #38bdf8, #0284c7);
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.logo-box {
    position: relative;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 0.75rem;
    border: 1px solid #e0f2fe;
    transition: all 0.5s;
}

/* .logo-box:hover {
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2);
} */

.icon-brand {
    width: 2rem;
    height: 2rem;
    color: #0284c7;
}

.logo-glow {
    position: absolute;
    inset: 0;
    background: #38bdf8;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.5s;
}

/* .logo-box:hover .logo-glow {
    opacity: 0.3;
} */

.header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.header-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.025em;
}

.header-section p {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
    font-weight: 500;
    max-width: 240px; /* Ограничиваем ширину для переноса */
    margin-left: auto; /* Центрируем блок после ограничения ширины */
    margin-right: auto;
    line-height: 1.4; /* Добавляем немного межстрочного интервала для читаемости */
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-left: 0.25rem;
    margin-bottom: 0.375rem;
}

/* Цвет иконки при фокусе на поле ввода */
.input-group:focus-within .icon-slate {
    color: #0ea5e9; /* Тот самый синий цвет бренда */
}

/* Цвет иконки глаза тоже меняем при фокусе на поле пароля */
.input-group:focus-within .password-toggle .icon-slate {
    color: #94a3b8;
}

.input-relative {
    position: relative;
}

/* Исправленный контейнер для иконок внутри инпутов */
.input-icon-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding-left: 12px;
    display: flex;
    align-items: center; /* Центрирует иконку по вертикали */
    justify-content: center;
    pointer-events: none;
}

/* Добавляем отступ между "Forgot password?" и кнопкой */
.forgot-password-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;    /* Отступ от поля пароля */
    margin-bottom: 2rem; /* Тот самый отступ до кнопки Sign In */
}

/* Фиксированный размер для иконок */
.icon-slate {
    height: 20px;
    width: 20px;
    color: #94a3b8; /* Серый в спокойном состоянии */
    transition: color 0.2s ease; /* Чтобы цвет менялся мягко */
}

/* Сам инпут с правильными отступами */
.styled-input {
    display: block;
    width: 100%;
    padding: 12px 40px 12px 40px; /* Отступы: сверху, справа (для глаза), снизу, слева (для иконки) */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    outline: none;
    transition: all 0.2s;
}

.styled-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.styled-input::placeholder {
    color: #94a3b8;
}

.btn-submit {
    width: 100%;
    height: 48px; /* Фиксированная высота для солидности */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem; /* Чуть крупнее текст */
    font-weight: 600;
    color: #ffffff;
    background-color: #0284c7;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background-color: #0369a1;
}

.btn-submit:active {
    transform: scale(0.98);
}

.text-link {
    color: #0284c7;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.text-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.footer-info {
    margin-top: 2rem;
    text-align: center;
}

.footer-text {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.footer-links a {
    font-size: 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #475569;
}

.divider {
    color: #e2e8f0;
}

/* Кнопка глаза для пароля */
.password-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    padding-right: 12px;
    display: flex;
    align-items: center; /* Центрирует глаз по вертикали */
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    z-index: 20;
}

/* Состояние при наведении на иконку глаза */
.password-toggle:hover .icon-slate {
    color: #475569 !important; /* Насыщенный синий при наведении */
}

.password-toggle:hover {
    color: #475569;
}

.hidden {
    display: none;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    } to {
        transform: rotate(360deg);
    }
}