/**
 * login.css - Страница входа (SaaS redesign)
 * Версия: 2.0
 */

/* =============================================
   RESET
   ============================================= */

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

body.login-page {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   SPLIT LAYOUT
   ============================================= */

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* =============================================
   BRAND PANEL (LEFT)
   ============================================= */

.login-brand-panel {
    flex: 0 0 45%;
    background: linear-gradient(160deg, #15572a 0%, #1e7d35 40%, #28a745 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 48px;
    position: relative;
    overflow: hidden;
}

/* Decorative pattern */
.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

/* Decorative circle */
.login-brand-panel::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    right: -120px;
    bottom: -120px;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    height: 44px;
    width: auto;
    filter: none;
}

.brand-tagline {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-top: 24px;
    max-width: 340px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 48px;
}

.brand-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.feature-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-top: 2px;
    line-height: 1.4;
}

.brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.brand-footer a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.brand-footer a:hover {
    color: #ffffff;
}

/* =============================================
   FORM PANEL (RIGHT)
   ============================================= */

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 48px;
}

.mobile-brand {
    display: none;
}

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

/* =============================================
   FORM HEADER
   ============================================= */

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

.form-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.form-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
}

/* =============================================
   ERROR MESSAGE
   ============================================= */

.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

.error-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #dc2626;
    fill: none;
    stroke-width: 2;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   LOGIN FORM
   ============================================= */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.login-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    stroke: #9ca3af;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: stroke 0.2s;
}

.input-wrapper:focus-within .input-icon {
    stroke: #218d33;
}

.login-form .form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #111827;
    transition: all 0.2s;
}

.login-form .form-input::placeholder {
    color: #9ca3af;
}

.login-form .form-input:focus {
    outline: none;
    border-color: #218d33;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(33,141,51,0.1);
}

/* Password field needs extra right padding for toggle */
.form-group:last-of-type .form-input {
    padding-right: 48px;
}

/* =============================================
   PASSWORD TOGGLE
   ============================================= */

.password-toggle {
    position: absolute;
    right: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

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

.password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =============================================
   SUBMIT BUTTON
   ============================================= */

.btn-login {
    margin-top: 4px;
    width: 100%;
    height: 48px;
    background: #218d33;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-login:hover {
    background: #1a7a2a;
    box-shadow: 0 4px 14px rgba(33,141,51,0.3);
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-loader svg {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

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

/* =============================================
   FORM FOOTER
   ============================================= */

.form-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 13px;
}

.form-footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.form-footer a:hover {
    color: #218d33;
}

/* =============================================
   RESPONSIVE: TABLET
   ============================================= */

@media (max-width: 1024px) {
    .login-brand-panel {
        flex: 0 0 40%;
        padding: 40px 36px;
    }

    .brand-tagline {
        font-size: 22px;
    }
}

/* =============================================
   RESPONSIVE: MOBILE
   ============================================= */

@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 0;
        background: #f3f4f6;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .mobile-brand {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 32px 24px 36px;
        background: linear-gradient(160deg, #15572a 0%, #1e7d35 50%, #28a745 100%);
    }

    .mobile-brand img {
        height: 36px;
        width: auto;
        filter: none;
    }

    .form-container {
        max-width: 100%;
        background: #ffffff;
        border-radius: 20px 20px 0 0;
        padding: 32px 24px 40px;
        margin-top: -16px;
        flex: 1;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
    }
}

/* =============================================
   RESPONSIVE: SMALL MOBILE
   ============================================= */

@media (max-width: 380px) {
    .form-container {
        padding: 28px 20px 36px;
    }

    .form-header h1 {
        font-size: 22px;
    }

    .mobile-brand {
        padding: 24px 20px 28px;
    }
}
