﻿:root {
    --primary-color: #512BD4; /* ASP.NET Core Purple */
    --primary-hover: #4020a3;
    --secondary-color: #f3f3f3;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --error-color: #dc3545;
    --success-color: #28a745;
    --border-radius: 8px;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--secondary-color);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Main Container */
.login-container {
    background: var(--white);
    width: 900px;
    max-width: 95%;
    height: 600px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Left Side - Visual/Branding */
.brand-section {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), #7b3ff2);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

    /* Abstract Background Pattern */
    .brand-section::before {
        content: '';
        position: absolute;
        top: -50px;
        left: -50px;
        width: 200px;
        height: 200px;
        border: 2px solid rgba(255,255,255,0.2);
        border-radius: 50%;
    }

    .brand-section::after {
        content: '';
        position: absolute;
        bottom: 50px;
        right: -50px;
        width: 300px;
        height: 300px;
        border: 2px solid rgba(255,255,255,0.2);
        border-radius: 50%;
    }

.brand-content {
    z-index: 2;
}

    .brand-content h1 {
        font-size: 2.5rem;
        margin-bottom: 20px;
        font-weight: 700;
    }

    .brand-content p {
        font-size: 1.1rem;
        opacity: 0.9;
        line-height: 1.6;
    }

/* Right Side - Form */
.form-section {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.form-header {
    margin-bottom: 30px;
}

    .form-header h2 {
        color: var(--text-dark);
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .form-header p {
        color: var(--text-light);
    }

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

    .input-group label {
        display: block;
        margin-bottom: 8px;
        color: var(--text-dark);
        font-weight: 600;
        font-size: 0.9rem;
    }

.input-wrapper {
    position: relative;
}

    .input-wrapper input {
        width: 100%;
        padding: 12px 15px 12px 40px; /* Left padding for icon */
        border: 1px solid #ddd;
        border-radius: var(--border-radius);
        font-size: 1rem;
        transition: var(--transition);
        outline: none;
    }

        .input-wrapper input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(81, 43, 212, 0.1);
        }

/* Icons inside inputs */
.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    width: 18px;
    height: 18px;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    width: 18px;
    height: 18px;
    transition: color 0.2s;
}

    .password-toggle:hover {
        color: var(--primary-color);
    }

/* Actions Row (Remember me / Forgot Password) */
.actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    cursor: pointer;
}

    .remember-me input {
        accent-color: var(--primary-color);
        width: 16px;
        height: 16px;
    }

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

    .forgot-password:hover {
        opacity: 0.8;
    }

/* Submit Button */
.btn-login {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .btn-login:hover {
        background-color: var(--primary-hover);
        transform: translateY(-1px);
    }

    .btn-login:active {
        transform: translateY(0);
    }

    .btn-login:disabled {
        background-color: #a0a0a0;
        cursor: not-allowed;
        transform: none;
    }

/* Spinner for loading state */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Validation Message */
.validation-msg {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.2s;
}

    .validation-msg.visible {
        opacity: 1;
    }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    background: white;
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid #ccc;
}

    .toast.show {
        transform: translateX(0);
    }

    .toast.success {
        border-left-color: var(--success-color);
    }

    .toast.error {
        border-left-color: var(--error-color);
    }

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    fill: var(--success-color);
}

.toast.error .toast-icon {
    fill: var(--error-color);
}

.toast-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.toast.success h4 {
    color: var(--success-color);
}

.toast.error h4 {
    color: var(--error-color);
}

.toast p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Role Dashboard Modal (Simulated Redirect) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

    .modal-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

.role-modal {
    background: white;
    width: 400px;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.modal-overlay.active .role-modal {
    transform: scale(1);
}

.role-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #eee;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 10px;
    color: var(--primary-color);
    background: rgba(81, 43, 212, 0.1);
}

.permissions-list {
    text-align: left;
    margin: 20px 0;
    padding: 0 20px;
    color: var(--text-light);
}

    .permissions-list li {
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.btn-logout {
    background: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-logout:hover {
        background: var(--error-color);
        color: white;
    }

/* Responsive */
@media (max-width: 768px) {
    .brand-section {
        display: none;
    }

    .login-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
