:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-surface: rgba(255, 255, 255, 0.85);
    /* Slightly more opaque for readability */
    --border-color: rgba(255, 255, 255, 0.6);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* 🔥 Animated Background */
.animated-bg {
    position: absolute;
    inset: 0;
    /* Rameda-inspired colors: Red, Orange, Blue, Green/Purple gradients */
    background: linear-gradient(-45deg, #FF3D00, #FF9100, #00B0FF, #00E676, #D500F9);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

.animated-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    /* Light overlay */
    backdrop-filter: blur(15px);
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 📱 Responsive Login Card */
.login-wrapper {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.login-card {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Logo Animation */
.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-img {
    height: 100px;
    /* Fit nicely */
    width: auto;
    margin-bottom: 16px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Ensure it handles transparency well */
    object-fit: contain;
}

.logo-img:hover {
    transform: scale(1.1) rotate(2deg);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

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

/* Input Fields */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-field {
    position: relative;
}

/* Icons */
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

/* Toggle Password Eye */
.toggle-pass {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 3;
    transition: color 0.2s;
    padding: 5px;
    /* increase clickable area */
}

.toggle-pass:hover {
    color: var(--primary);
}

.input-field input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    /* Space for both icons */
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
}

.input-field input:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Validation Errors */
.field-error {
    color: var(--error-color);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
    display: block;
    min-height: 18px;
    /* prevents jumping */
}

.input-field input.invalid {
    border-color: var(--error-color);
    background: #fff5f5;
}

/* Buttons & Links */
.forgot-pass-wrapper {
    text-align: right;
    margin-bottom: 20px;
    margin-top: -10px;
}

.link-sm {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.footer-link,
.back-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-link a,
.back-link a {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    margin-left: 4px;
}

/* Status Messages */
.status-msg {
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.error {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Mobile Optimization */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 24px;
        max-width: 100%;
    }

    h1 {
        font-size: 1.25rem;
    }
}

.top-bar {
    display: flex;
    justify-content: space-between;
    /* Pushes dropdown to left and logout to right */
    align-items: center;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}