/*
 * ЛПЭК - Система Авторизации
 * Обновленный дизайн из unified-login.html
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Декоративные фоновые элементы */
.bg-shape-left {
    position: absolute;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: #2b3a9f;
    border-radius: 50%;
    z-index: 0;
}

.bg-shape-right-top {
    position: absolute;
    top: -150px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: #3d4db7;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.8;
}

.bg-shape-right-bottom {
    position: absolute;
    bottom: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: #2b3a9f;
    border-radius: 50%;
    z-index: 0;
}

/* Экран входа */
.login-screen,
.auth-screen {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    transition: opacity 0.5s ease;
}

.login-screen.hiding,
.auth-screen.hiding {
    opacity: 0;
}

.container {
    display: flex;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.login-section {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-section {
    flex: 1;
    background: linear-gradient(135deg, #2b3a9f 0%, #3d4db7 100%);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.info-section::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

h1 {
    color: #2b3a9f;
    font-size: 36px;
    margin-bottom: 40px;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 12px;
    padding: 16px 20px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.input-wrapper.focused {
    background: white;
    border-color: #2b3a9f;
}

.input-wrapper:hover {
    background: #f0f0f0;
}

.input-wrapper.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.input-icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    color: #2b3a9f;
    flex-shrink: 0;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    outline: none;
}

input::placeholder {
    color: #999;
}

.field-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.form-error {
    background: #dc3545;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.form-error.show {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #2b3a9f;
}

.checkbox-label {
    color: #666;
    font-size: 14px;
}

.forgot-link {
    color: #2b3a9f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-button,
.btn-primary {
    width: 100%;
    padding: 16px;
    background: #2b3a9f;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}

.login-button:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: #1f2a75;
    box-shadow: 0 8px 20px rgba(43, 58, 159, 0.3);
}

.login-button:active:not(:disabled),
.btn-primary:active:not(:disabled) {
}

.login-button:disabled,
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-button .button-text,
.btn-primary .button-text {
    transition: opacity 0.3s ease;
}

.login-button.loading .button-text,
.btn-primary.loading .button-text {
    opacity: 0;
}

.spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-button.loading .spinner,
.btn-primary.loading .spinner {
    opacity: 1;
}

@keyframes spin {
    to { }
}

.divider {
    text-align: center;
    color: #999;
    margin: 20px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #ddd;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.google-button {
    width: 100%;
    padding: 16px;
    background: white;
    color: #2b3a9f;
    border: 2px solid #2b3a9f;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.google-button:hover {
    background: #f8f8ff;
    box-shadow: 0 8px 20px rgba(43, 58, 159, 0.15);
    color: #2b3a9f;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.info-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo {
    max-width: 300px;
    width: 80%;
    height: auto;
    margin-bottom: 40px;
    filter: brightness(0) invert(1);
}

.info-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.info-subtitle {
    font-size: 24px;
    font-weight: 400;
    opacity: 0.95;
}

/* Dashboard */
.dashboard-screen {
    display: none;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    animation: fadeInUp 0.6s ease;
}

.dashboard-screen.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dashboard-container {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.dashboard-logo {
    max-width: 200px;
    height: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #2b3a9f, #3d4db7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    color: #666;
}

.logout-button {
    background: transparent;
    border: 2px solid #e0e0e0;
    color: #666;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.logout-button:hover {
    border-color: #2b3a9f;
    color: #2b3a9f;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 700;
    color: #2b3a9f;
    margin-bottom: 10px;
}

.dashboard-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 35px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.app-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(43, 58, 159, 0.05), transparent);
    transition: left 0.6s ease;
}

.app-card:hover::before {
    left: 100%;
}

.app-card:hover {
    border-color: #2b3a9f;
    box-shadow: 0 15px 40px rgba(43, 58, 159, 0.15);
}

.app-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2b3a9f, #3d4db7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.app-card:hover .app-icon {
}

.app-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.app-title {
    font-size: 22px;
    font-weight: 700;
    color: #2b3a9f;
    margin-bottom: 10px;
}

.app-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.app-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #2e7d32;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Django Messages */
.django-messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Адаптивность */
@media (max-width: 968px) {
    .container {
        flex-direction: column;
    }

    .info-section {
        order: -1;
        padding: 40px 30px;
    }

    .login-section {
        padding: 40px 30px;
    }

    .info-title {
        font-size: 32px;
    }

    .info-subtitle {
        font-size: 20px;
    }

    .dashboard-container {
        padding: 30px 20px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .dashboard-title {
        font-size: 26px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        border-radius: 15px;
    }

    h1 {
        font-size: 28px;
    }

    .info-title {
        font-size: 26px;
    }

    .info-subtitle {
        font-size: 18px;
    }

    .dashboard-logo {
        max-width: 150px;
    }

    .dashboard-title {
        font-size: 22px;
    }

    .app-card {
        padding: 25px;
    }
}

/* === FORGOT PASSWORD & REGISTER PAGES === */

/* Form Section */
.form-section {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    color: #2b3a9f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-button:hover {
}

.back-button svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Subtitle */
.subtitle {
    color: #666;
    font-size: 15px;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.step {
    display: flex;
    align-items: center;
    flex: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: linear-gradient(135deg, #2b3a9f, #3d4db7);
    color: white;
}

.step.completed .step-number {
    background: #4CAF50;
    color: white;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 15px;
}

.step.completed .step-line {
    background: #4CAF50;
}

/* Input Label */
.input-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Input Row (for two-column layout) */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Select element */
select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    outline: none;
    cursor: pointer;
}

select option {
    color: #333;
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: 16px;
    background: #2b3a9f;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    margin-top: 30px;
}

.submit-button:hover:not(:disabled) {
    background: #1f2a75;
    box-shadow: 0 8px 20px rgba(43, 58, 159, 0.3);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-button .button-text {
    transition: opacity 0.3s ease;
}

.submit-button.loading .spinner {
    opacity: 1;
}

.submit-button.loading .button-text {
    opacity: 0;
}

/* Success Message */
.success-message {
    display: none;
    background: #e8f5e9;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    color: #2e7d32;
}

.success-message.show {
    display: block;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.success-icon {
    width: 48px;
    height: 48px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.success-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.success-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.success-text {
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

/* Info List (for forgot password page) */
.info-list {
    text-align: left;
    margin-top: 30px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.info-item-icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    flex-shrink: 0;
    color: white;
}

.info-item-text {
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
}

/* Benefits List (for register page) */
.benefits-list {
    text-align: left;
    margin-top: 30px;
}

.benefit-item {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.benefit-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.benefit-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

.benefit-text {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.password-strength.show {
    display: block;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.password-strength-bar.weak {
    width: 33%;
    background: #f44336;
}

.password-strength-bar.medium {
    width: 66%;
    background: #FF9800;
}

.password-strength-bar.strong {
    width: 100%;
    background: #4CAF50;
}

.password-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-link a {
    color: #2b3a9f;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Additional Responsive Styles */
@media (max-width: 968px) {
    .form-section {
        padding: 40px 30px;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .step-indicator {
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 35px 25px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* === ADMIN LOGIN PAGE === */

/* Alert messages */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Form subtitle */
.form-subtitle {
    color: #666;
    font-size: 15px;
    margin-top: 8px;
    margin-bottom: 30px;
}

/* Secondary button */
.secondary-button {
    width: 100%;
    padding: 14px;
    background: #f8f8f8;
    color: #2b3a9f;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.secondary-button:hover {
    background: #f0f0f0;
    border-color: #2b3a9f;
    box-shadow: 0 4px 12px rgba(43, 58, 159, 0.15);
}

.secondary-button svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Toggle password button */
.toggle-password {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #2b3a9f;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Error message styling */
.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Admin login layout */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #2b3a9f 0%, #3d4db7 100%);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.login-right {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-section {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 50px;
}

.logo-section .logo {
    margin: 0 auto 20px;
}

.logo-section h1 {
    color: white;
    font-size: 42px;
    margin-bottom: 10px;
}

.logo-section p {
    font-size: 18px;
    opacity: 0.95;
}

.info-card {
    display: flex;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.info-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.info-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.info-card h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.info-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.login-form-container {
    max-width: 100%;
}

.form-header {
    margin-bottom: 30px;
}

.form-header h2 {
    color: #2b3a9f;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-form {
    margin-top: 20px;
}

.forgot-password {
    display: block;
    text-align: right;
    color: #2b3a9f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 15px;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Responsive admin login */
@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
    }

    .login-left {
        order: -1;
        padding: 40px 30px;
    }

    .login-right {
        padding: 40px 30px;
    }

    .logo-section h1 {
        font-size: 32px;
    }

    .logo-section p {
        font-size: 16px;
    }

    .form-header h2 {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .login-left {
        padding: 35px 25px;
    }

    .login-right {
        padding: 35px 25px;
    }

    .logo-section h1 {
        font-size: 28px;
    }

    .info-card {
        padding: 15px;
    }

    .form-header h2 {
        font-size: 24px;
    }
}
