﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #732d43;
    --primary-dark: #7a1450;
    --primary-light: #b83280;
    --secondary: #f59e0b;
    --accent: #d946ef;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    font-size: 15px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Login Wrapper */
.login-wrapper {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 50%, var(--gray-100) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    position: relative;
}

    .login-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: radial-gradient(circle at 15% 25%, rgba(146, 24, 96, 0.08) 0%, transparent 50%), radial-gradient(circle at 85% 75%, rgba(217, 70, 239, 0.06) 0%, transparent 50%), radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
        z-index: 1;
    }

.min-vh-100 {
    min-height: 100vh;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

/* Login Container - Центриран */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Visual Section - Скрита */
.login-visual-section {
    display: none !important;
}

/* Form Section */
.login-form-section {
    padding: 3rem 2.5rem;
    width: 100%;
    background: var(--white);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--white);
    font-size: 1.75rem;
    box-shadow: 0 10px 30px rgba(146, 24, 96, 0.3);
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0;
}

/* Form Styles */
.login-form {
    flex: 1;
}

.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.1rem;
    color: var(--gray-500);
    font-size: 1rem;
    z-index: 2;
    transition: color 0.2s ease;
}

.form-input-modern {
    width: 100%;
    padding: 1rem 1.1rem 1rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--gray-900);
    font-family: inherit;
}

    .form-input-modern:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(146, 24, 96, 0.1);
    }

        .form-input-modern:focus ~ .input-icon,
        .form-input-modern:focus + .input-icon {
            color: var(--primary);
        }

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 2;
    font-size: 1rem;
}

    .password-toggle:hover {
        color: var(--primary);
        background: rgba(146, 24, 96, 0.1);
    }

.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.6rem;
    font-weight: 500;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

    .checkbox-input:checked + .checkbox-custom::after {
        content: '✓';
        color: var(--white);
        font-size: 0.8rem;
        font-weight: bold;
    }

.checkbox-label {
    font-size: 0.95rem;
    color: var(--gray-700);
    font-weight: 500;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .forgot-password:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* Login Button */
.btn-login {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1.125rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(146, 24, 96, 0.3);
}

    .btn-login:not(:disabled):hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 35px rgba(146, 24, 96, 0.4);
    }

    .btn-login:active {
        transform: translateY(0);
    }

    .btn-login:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    transition: opacity 0.3s ease;
}

.btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.btn-login.loading .btn-content {
    opacity: 0;
}

.btn-login.loading .btn-loading {
    opacity: 1;
}

/* Divider */
.login-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

    .login-divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: var(--gray-200);
    }

    .login-divider span {
        background: var(--white);
        color: var(--gray-500);
        padding: 0 1.5rem;
        font-size: 0.95rem;
        position: relative;
        font-weight: 500;
    }

/* Signup Prompt */
.signup-prompt {
    text-align: center;
    margin-top: 1rem;
}

    .signup-prompt p {
        color: var(--gray-600);
        margin: 0;
        font-size: 1rem;
    }

.signup-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

    .signup-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* Validation Summary */
.validation-summary {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

    .validation-summary ul {
        margin: 0;
        padding-left: 1.5rem;
    }

    .validation-summary li {
        color: var(--danger);
        font-size: 0.95rem;
        font-weight: 500;
    }

/* Enhanced Input States */
.form-input-modern.has-value {
    border-color: var(--success);
}

.form-input-modern:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--danger);
}

/* Alert Danger */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Large Desktops (1400px+) */
@media (min-width: 1400px) {
    .login-container {
        max-width: 600px;
    }

    .login-form-section {
        padding: 3.5rem 3rem;
    }

    .login-title {
        font-size: 2.25rem;
    }

    .brand-logo {
        width: 72px;
        height: 72px;
        font-size: 2rem;
    }
}

/* Standard Desktop (992px - 1399px) */
@media (min-width: 992px) and (max-width: 1399px) {
    .login-form-section {
        padding: 2.75rem 2.25rem;
    }
}

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
    .login-wrapper {
        padding: 1.5rem 0;
    }

    .login-container {
        max-width: 500px;
        border-radius: 20px;
    }

    .login-form-section {
        padding: 2.5rem 2rem;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .login-subtitle {
        font-size: 0.95rem;
    }

    .brand-logo {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
}

/* Mobile Landscape / Small Tablets (576px - 767px) */
@media (max-width: 767px) {
    .login-wrapper {
        padding: 1rem 0;
    }

    .login-container {
        border-radius: 18px;
        max-width: 100%;
    }

    .login-form-section {
        padding: 2rem 1.5rem;
    }

    .login-header {
        margin-bottom: 2rem;
    }

    .login-title {
        font-size: 1.625rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }

    .form-group-modern {
        margin-bottom: 1.25rem;
    }

    .form-input-modern {
        padding: 0.875rem 1rem 0.875rem 2.75rem;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 1rem;
        font-size: 0.95rem;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .btn-login {
        padding: 1rem;
        font-size: 1rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.875rem;
    }
}

/* Mobile Portrait (375px - 575px) */
@media (max-width: 575px) {
    .login-wrapper {
        padding: 0.75rem 0;
    }

    .container {
        padding: 0 0.75rem;
    }

    .login-container {
        border-radius: 16px;
    }

    .login-form-section {
        padding: 1.75rem 1.25rem;
    }

    .login-header {
        margin-bottom: 1.75rem;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 0.875rem;
    }

    .form-group-modern {
        margin-bottom: 1.125rem;
    }

    .form-label-modern {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .form-input-modern {
        padding: 0.825rem 0.9rem 0.825rem 2.6rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .input-icon {
        left: 0.9rem;
        font-size: 0.9rem;
    }

    .password-toggle {
        right: 0.75rem;
        font-size: 0.9rem;
        padding: 0.4rem;
    }

    .checkbox-custom {
        width: 20px;
        height: 20px;
    }

    .checkbox-label {
        font-size: 0.875rem;
    }

    .forgot-password {
        font-size: 0.875rem;
    }

    .btn-login {
        padding: 0.9rem;
        font-size: 0.95rem;
        border-radius: 10px;
        margin-bottom: 1.25rem;
    }

    .login-divider {
        margin: 1.25rem 0;
    }

    .signup-prompt p {
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile (320px - 374px) */
@media (max-width: 374px) {
    .login-wrapper {
        padding: 0.5rem 0;
    }

    .container {
        padding: 0 0.5rem;
    }

    .login-form-section {
        padding: 1.5rem 1rem;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .login-title {
        font-size: 1.375rem;
    }

    .login-subtitle {
        font-size: 0.85rem;
    }

    .form-group-modern {
        margin-bottom: 1rem;
    }

    .form-input-modern {
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
        font-size: 0.875rem;
    }

    .input-icon {
        left: 0.875rem;
        font-size: 0.875rem;
    }

    .btn-login {
        padding: 0.825rem;
        font-size: 0.9rem;
    }
}

/* Very Large Screens (1920px+) */
@media (min-width: 1920px) {
    .login-container {
        max-width: 650px;
    }

    .login-form-section {
        padding: 4rem 3.5rem;
    }

    .login-title {
        font-size: 2.5rem;
    }

    .form-group-modern {
        margin-bottom: 1.875rem;
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: slideInUp 0.5s ease-out;
}

.form-group-modern {
    opacity: 0;
    animation: slideInUp 0.5s ease-out forwards;
}

    .form-group-modern:nth-child(1) {
        animation-delay: 0.1s;
    }

    .form-group-modern:nth-child(2) {
        animation-delay: 0.15s;
    }

    .form-group-modern:nth-child(3) {
        animation-delay: 0.2s;
    }

.form-options {
    animation: slideInUp 0.5s ease-out 0.25s both;
}

.btn-login {
    animation: slideInUp 0.5s ease-out 0.3s both;
}

.login-divider {
    animation: slideInUp 0.5s ease-out 0.35s both;
}

.signup-prompt {
    animation: slideInUp 0.5s ease-out 0.4s both;
}

/* Focus States for Accessibility */
.btn-login:focus,
.forgot-password:focus,
.signup-link:focus,
.checkbox-wrapper:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-input-modern:focus {
    outline: none;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .form-input-modern {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .password-toggle {
        padding: 0.75rem; /* Larger touch target */
    }

    .checkbox-custom {
        width: 24px;
        height: 24px;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .login-wrapper {
        padding: 1rem 0;
    }

    .login-form-section {
        padding: 1.5rem;
    }

    .login-header {
        margin-bottom: 1.25rem;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }

    .login-title {
        font-size: 1.375rem;
    }

    .form-group-modern {
        margin-bottom: 1rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .login-container {
        border: 2px solid var(--gray-900);
    }

    .form-input-modern {
        border-width: 2px;
    }

    .btn-login {
        border: 2px solid var(--primary-dark);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .login-container {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }

    .login-wrapper {
        background: var(--white);
    }

        .login-wrapper::before {
            display: none;
        }
}
