:root {
    --primary-color: #3b82f6;
    /* Vibrant Blue */
    --primary-dark: #2563eb;
    --secondary-color: #64748b;
    /* Slate */
    --bg-dark: #0f172a;
    /* Deep Navy */
    --bg-card: rgba(30, 41, 59, 0.7);
    /* Glassy Navy */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(59, 130, 246, 0.5);
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Background Effects */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.6;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    top: -100px;
    left: -100px;
    animation: float 10s infinite ease-in-out;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
    bottom: -50px;
    right: -50px;
    animation: float 12s infinite ease-in-out reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    z-index: 1;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Branding Section (Left) */
.login-branding {
    padding-right: 2rem;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary-color);
}

.logo span {
    color: var(--primary-color);
}

.badge-enterprise {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    letter-spacing: 0.05em;
}

.headline {
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typewriter-container {
    display: inline-block;
    min-height: 1.2em;
}

.typewriter-text {
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
    background: none;
    position: relative;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--primary-color);
    animation: blink 1s step-end infinite;
    margin-left: 5px;
    vertical-align: middle;
    height: 1em;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.subheadline {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 90%;
}

.enterprise-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

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

.feature-text {
    display: flex;
    flex-direction: column;
}

.feature-text strong {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.feature-text span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.trust-badges {
    display: flex;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.trust-badges span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.trust-badges i {
    color: var(--success-color);
}

/* Login Card (Right) */
.module-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 3rem;
    /* Padding left for icon */
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: white;
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: none;
    /* Hidden by default */
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-body);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem;
    font-size: 1.05rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.card-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.card-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Alerts */
.alert-box {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.5s ease-out forwards;
    transition: opacity 0.5s ease;
}

.alert-box.error {
    border-left-color: var(--error-color);
}

.alert-box.success {
    border-left-color: var(--success-color);
}

.alert-icon {
    font-size: 1.5rem;
}

.error .alert-icon {
    color: var(--error-color);
}

.success .alert-icon {
    color: var(--success-color);
}

.alert-content {
    display: flex;
    flex-direction: column;
}

.alert-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.alert-message {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 450px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-delayed {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.3s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .login-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 600px;
        margin: 0 auto;
    }

    .login-branding {
        text-align: center;
        padding-right: 0;
        display: none;
        /* Hide branding on smaller tablets/mobile to focus on login */
    }

    .brand-header {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .module-card {
        padding: 2rem 1.5rem;
    }

    .headline {
        font-size: 2rem;
    }

    .login-branding {
        display: block;
        /* Show branding again but simplified */
        margin-bottom: 2rem;
    }

    .enterprise-features,
    .trust-badges,
    .subheadline {
        display: none;
    }

    .headline {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .brand-header {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        align-items: flex-start;
        padding-top: 2rem;
        height: auto;
        min-height: 100vh;
    }

    .headline {
        font-size: 1.5rem;
    }

    .module-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .card-header h2 {
        font-size: 1.5rem;
    }

    .form-control {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}