/* === EduOkrug Staff Portal - Login Page Styles === */
/* Изолированный CSS для страницы авторизации */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #0ea5e9;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --text: #475569;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --gradient: linear-gradient(135deg, var(--primary), var(--accent));
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-text: #92400e;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-text: #991b1b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.12);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
    --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    min-height: 100vh;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

a { color: inherit; }

.icon {
    width: 16px; height: 16px;
    stroke-width: 2;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* === AUTH CONTAINER === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at top left, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #ecfeff 100%);
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.auth-card-wrapper {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

/* === AUTH CARD === */
.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === LOGO === */
.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.4);
    position: relative;
}

.auth-logo svg {
    width: 28px;
    height: 28px;
    color: white;
}

.auth-logo::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: var(--gradient);
    opacity: 0.2;
    z-index: -1;
    filter: blur(16px);
}

/* === HEADER === */
.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 13.5px;
    color: var(--text-light);
    line-height: 1.55;
}

/* === SECURITY NOTICE === */
.security-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--warning-text);
    line-height: 1.4;
}

.security-notice svg {
    color: var(--warning);
    flex-shrink: 0;
}

/* === ERROR MESSAGE === */
.auth-error {
    background: var(--danger-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 13px 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.auth-error svg {
    width: 18px;
    height: 18px;
    color: var(--danger);
    flex-shrink: 0;
    margin-top: 1px;
}

.error-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.error-content span {
    color: var(--danger-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    word-wrap: break-word;
}

.error-support-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.15s;
}

.error-support-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* === FORM === */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forgot-password {
    font-size: 11.5px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
    color: var(--dark);
    background: white;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--text-light);
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--bg);
}

/* === CHECKBOX === */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text);
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '';
    width: 9px;
    height: 9px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.checkbox-input:focus-visible + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
}

.checkbox-text {
    color: var(--text);
    line-height: 1.4;
}

/* === AUTH BUTTON === */
.btn-auth {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--gradient);
    color: white;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    font-family: inherit;
    position: relative;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -4px rgba(37, 99, 235, 0.55);
}

.btn-auth:active:not(:disabled) {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.9;
    cursor: not-allowed;
}

.btn-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.btn-auth:hover:not(:disabled) .btn-icon {
    transform: translateX(3px);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* === DIVIDER === */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* === SSO BUTTON === */
.btn-sso {
    width: 100%;
    padding: 11px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--dark);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.btn-sso:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-sso svg {
    color: var(--primary);
}

/* === FOOTER === */
.auth-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-policy p {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-policy a {
    color: var(--text-light);
    text-decoration: underline;
    text-decoration-color: rgba(100, 116, 139, 0.3);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.15s;
}

.footer-policy a:hover {
    color: var(--primary);
    text-decoration-color: var(--primary);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links .separator {
    color: var(--border-strong);
    font-size: 10px;
    user-select: none;
}

.footer-copyright {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .auth-card {
        padding: 28px 22px;
        border-radius: var(--radius-lg);
    }
    
    .auth-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    
    .auth-logo svg {
        width: 24px;
        height: 24px;
    }
    
    .auth-title {
        font-size: 19px;
    }
    
    .auth-subtitle {
        font-size: 13px;
    }
    
    .footer-links {
        gap: 6px;
        font-size: 11px;
    }
}

@media (max-height: 700px) {
    .auth-container {
        align-items: flex-start;
        padding-top: 24px;
        padding-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
