/*
|--------------------------------------------------------------------------
| Viartas Admin Theme - Login Page Styles
|--------------------------------------------------------------------------
*/

:root {
    --primary: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --dark-50: #f8fafc;
    --dark-100: #f1f5f9;
    --dark-200: #e2e8f0;
    --dark-300: #cbd5e1;
    --dark-400: #94a3b8;
    --dark-500: #64748b;
    --dark-600: #475569;
    --dark-700: #334155;
    --dark-800: #1e293b;
    --dark-900: #0f172a;
    --card-bg: #ffffff;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-100);
    min-height: 100vh;
}

/* ========================================================================
   Login Wrapper
   ======================================================================== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

.brand-logo img {
    width: 200px;
}

.mobile-logo img {
    width: 200px;
}

/* ========================================================================
   Left Side - Branding
   ======================================================================== */
.login-branding {
    flex: 0 0 45%;
    background: linear-gradient(135deg, var(--dark-800) 0%, var(--dark-900) 100%);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.login-branding::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

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

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 60px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: white;
}

/* Branding Text */
.branding-title {
    font-size: 48px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 20px;
}

.branding-subtitle {
    font-size: 18px;
    color: var(--dark-400);
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 60px;
}

/* Features */
.branding-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}

.feature-text h4 {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.feature-text p {
    font-size: 14px;
    color: var(--dark-400);
}

/* Footer */
.branding-footer {
    position: relative;
    z-index: 1;
}

.branding-footer p {
    font-size: 14px;
    color: var(--dark-500);
}

/* ========================================================================
   Right Side - Login Form
   ======================================================================== */
.login-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--dark-50);
}

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

/* Mobile Logo - Hidden on Desktop */
.mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.mobile-logo .logo-icon {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.mobile-logo .logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark-800);
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark-800);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 15px;
    color: var(--dark-500);
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-700);
    background: var(--card-bg);
    border: 2px solid var(--dark-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn:hover {
    border-color: var(--dark-300);
    background: var(--dark-50);
}

.social-btn svg {
    flex-shrink: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

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

.divider span {
    font-size: 13px;
    color: var(--dark-500);
    white-space: nowrap;
}

/* Form */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-700);
    margin-bottom: 8px;
}

/* When label is inside label-row, adjust spacing */
.label-row .form-label {
    margin-bottom: 0;
}

.label-row + .input-wrapper {
    margin-top: 8px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

.forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.input-wrapper {
    position: relative;
}

.input-wrapper > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-400);
    font-size: 16px;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    font-family: inherit;
    color: var(--dark-700);
    background: var(--card-bg);
    border: 2px solid var(--dark-200);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.form-input:hover {
    border-color: var(--dark-300);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-input::placeholder {
    color: var(--dark-400);
}

/* Invalid/Error States */
.form-input.is-invalid {
    border-color: var(--danger);
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.invalid-feedback {
    display: block;
    width: 100%;
    font-size: 13px;
    color: var(--danger);
    margin-top: 8px;
    padding-left: 2px;
}

.invalid-feedback strong {
    font-weight: 500;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    background: var(--card-bg);
    border: 2px solid var(--dark-200);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

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

.checkbox-wrapper input:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    font-size: 14px;
    color: var(--dark-600);
}

/* Submit Button */
.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* Loading State */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading span {
    display: none;
}

.btn-login.loading i {
    animation: spin 1s linear infinite;
}

.btn-login.loading::before {
    content: 'Signing in...';
}

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

/* Footer */
.login-footer {
    text-align: center;
}

.login-footer p {
    font-size: 14px;
    color: var(--dark-500);
}

.login-footer a {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ========================================================================
   Alert Box
   ======================================================================== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 1024px) {
    .login-branding {
        flex: 0 0 40%;
        padding: 40px;
    }

    .branding-title {
        font-size: 40px;
    }
}

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

    .login-branding {
        display: none;
    }

    .login-form-wrapper {
        padding: 32px 24px;
        min-height: 100vh;
    }

    .mobile-logo {
        display: flex;
    }

    .login-header {
        margin-bottom: 28px;
    }

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

@media (max-width: 480px) {
    .social-login {
        gap: 10px;
    }

    .social-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .form-input {
        padding: 12px 16px 12px 44px;
        font-size: 14px;
    }

    .btn-login {
        padding: 14px 20px;
        font-size: 15px;
    }
}
