:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: rgba(79, 70, 229, 0.12);
    --primary-glow: rgba(79, 70, 229, 0.28);
    --font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    --bg-color: #0B0F19;
    --card-bg: rgba(255, 255, 255, 0.95);
}

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

body {
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0F172A;
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.18) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(244, 63, 94, 0.12) 0px, transparent 50%),
        radial-gradient(at 80% 90%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
        radial-gradient(at 10% 90%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    color: #0F172A;
    position: relative;
    overflow-x: hidden;
    padding: 24px;
}

/* Ambient animated light blobs */
.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
    animation: floatBlob 14s infinite ease-in-out alternate;
}

.blob-1 {
    width: 380px;
    height: 380px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    top: -60px;
    left: -80px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #EC4899, #F43F5E);
    bottom: -50px;
    right: -60px;
    animation-duration: 18s;
    animation-direction: alternate-reverse;
}

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

/* Background grid overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Main Container */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card Styling */
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 40px 32px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Brand / Header */
.brand-section {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.2);
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.brand-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.brand-logo-container .logo-fallback {
    font-size: 28px;
    line-height: 1;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0F172A;
    margin-bottom: 4px;
}

.brand-subtitle {
    font-size: 0.875rem;
    color: #64748B;
    font-weight: 500;
}

/* Alert / Errors */
.alert-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Form Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: #94A3B8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-control {
    width: 100%;
    padding: 13px 16px 13px 46px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0F172A;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.form-control::placeholder {
    color: #94A3B8;
    font-weight: 400;
}

.form-control:hover {
    border-color: #CBD5E1;
    background: #FFFFFF;
}

.form-control:focus {
    background: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), 0 2px 4px rgba(0,0,0,0.02);
}

.form-control:focus + .input-icon,
.input-container:focus-within .input-icon {
    color: var(--primary);
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    padding: 6px;
    color: #94A3B8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

.toggle-password:hover {
    color: #475569;
    background-color: #F1F5F9;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.975rem;
    font-weight: 700;
    font-family: inherit;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--primary) 0%, #3730A3 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 20px -5px var(--primary-glow);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 26px;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px -5px var(--primary-glow);
}

.btn-submit:hover::after {
    left: 100%;
}

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

.btn-submit svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.btn-submit:hover svg {
    transform: translateX(3px);
}

/* Footer info */
.login-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.775rem;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Demo credentials box (local only) */
.demo-box {
    margin-top: 24px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: 14px;
    border: 1px dashed #CBD5E1;
    font-size: 0.8rem;
    color: #475569;
}

.demo-box-header {
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.demo-box li {
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

.demo-box code {
    background: #E2E8F0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #0F172A;
    font-size: 0.75rem;
}
