/* Import modern Outfit font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark-deep: #080b11;
    --bg-dark-panel: #0d121f;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-glow: rgba(99, 102, 241, 0.25);
    --color-secondary: #3b82f6;
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.08);
    --color-success-border: rgba(16, 185, 129, 0.2);
    --color-error: #f43f5e;
    --color-error-bg: rgba(244, 63, 94, 0.08);
    --color-error-border: rgba(244, 63, 94, 0.2);
    --text-main: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Core Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark-deep);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Full Width Split Screen Layout */
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Brand Section (Left Panel) */
.brand-section {
    flex: 1.2;
    background-color: var(--bg-dark-panel);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem;
    overflow: hidden;
    border-right: 1px solid var(--border-glass);
}

/* Animated Ambient Glow Orbs in Brand Panel */
.brand-bg-glows {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation: floatOrb 18s infinite alternate ease-in-out;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation: floatOrb 22s infinite alternate-reverse ease-in-out;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #a855f7 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation: floatOrb 15s infinite alternate ease-in-out;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.1); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}

.brand-header {
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-showcase {
    z-index: 2;
    max-width: 520px;
    margin: auto 0;
}

.brand-tagline {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-footer {
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Form Section (Right Panel) */
.form-section {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    background-color: var(--bg-dark-deep);
}

.form-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 65%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Login Card Container */
.login-container {
    width: 100%;
    max-width: 440px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    z-index: 1;
    animation: cardEntrance 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Custom Status Banners */
.alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    animation: alertSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-left: 4px solid transparent;
}

@keyframes alertSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-msg {
    background-color: var(--color-error-bg);
    border-left-color: var(--color-error);
    border-top: 1px solid var(--color-error-border);
    border-right: 1px solid var(--color-error-border);
    border-bottom: 1px solid var(--color-error-border);
    color: #fda4af;
}

.success-msg {
    background-color: var(--color-success-bg);
    border-left-color: var(--color-success);
    border-top: 1px solid var(--color-success-border);
    border-right: 1px solid var(--color-success-border);
    border-bottom: 1px solid var(--color-success-border);
    color: #6ee7b7;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Forms & Floating Labels */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 1.1rem 1rem 1.1rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

/* Indent password text slightly to prevent overlap with toggle button */
.form-input[type="password"],
.form-input.password-type {
    padding-right: 3rem;
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.form-input:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px var(--color-primary-glow);
}

/* Floating Label Animation logic */
.form-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition-smooth);
    background-color: transparent;
    padding: 0 0.25rem;
}

/* Label transitions up on focus or when input is not empty */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: var(--color-primary);
    background-color: #0b0f19; /* Mask lines behind it. Fits dark theme */
    font-weight: 500;
}

/* Password Toggle Icon Button */
.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
    z-index: 10;
}

.password-toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Submit Button & Actions */
.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

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

/* Loading State for Submit Button */
.btn-text {
    transition: var(--transition-smooth);
}

.submit-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

.submit-btn.loading {
    pointer-events: none;
    background: var(--color-primary-hover);
}

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

.submit-btn.loading .submit-spinner {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    margin-top: -10px;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .brand-section {
        padding: 3rem;
    }
    .brand-tagline {
        font-size: 2.5rem;
    }
}

@media (max-width: 868px) {
    .brand-section {
        display: none; /* Hide brand panel on tablet/mobile size */
    }
    
    .form-section {
        flex: 1;
        background-color: var(--bg-dark-deep);
        padding: 2rem 1.5rem;
    }
    
    .login-container {
        border: none;
        background: transparent;
        box-shadow: none;
        padding: 1rem;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
