* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    position: relative;
}

/* Едва заметная текстура фона */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 2px,
            rgba(0, 0, 0, 0.01) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.login-box {
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 2px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 48px 40px;
    position: relative;
}

/* Верхняя полоса как в корпоративных системах */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #2563eb;
}

.logo {
    margin: 0 auto 24px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    width: 100%;
    height: 100%;
}

h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin-bottom: 32px;
}

.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 2px;
    margin-bottom: 24px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    border-left: 3px solid;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    border-color: #dc2626;
}

.success-message {
    background: #f0fdf4;
    color: #166534;
    border-color: #16a34a;
}

.error-message svg,
.success-message svg {
    flex-shrink: 0;
    margin-top: 1px;
}

form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #cbd5e0;
    border-radius: 2px;
    transition: all 0.2s ease;
    font-family: inherit;
    background: #ffffff;
    color: #1e293b;
}

input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #ffffff;
}

input::placeholder {
    color: #94a3b8;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.footer-links {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.footer-links a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-links a:hover {
    color: #1e40af;
    text-decoration: underline;
}

.separator {
    margin: 0 12px;
    color: #cbd5e0;
}

.page-footer {
    text-align: center;
    margin-top: 24px;
    color: #64748b;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
    
    h1 {
        font-size: 19px;
    }
    
    .container {
        padding: 16px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    animation: fadeIn 0.5s ease;
}

/* Loader для успешного входа */
.loader {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
