:root {
    --bg-color: #0b0914;
    --card-bg: rgba(20, 18, 28, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: rgba(255, 255, 255, 0.3);
    --btn-bg: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --btn-text: #ffffff;
    --btn-hover-transform: translateY(-2px);
    --btn-hover-shadow: 0 10px 20px -10px rgba(168, 85, 247, 0.5);
    --error-color: #fb7185;
    
    /* Vibrant blobs */
    --blob-1: #4f46e5;
    --blob-2: #c026d3;
    --blob-3: #2563eb;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    /* Soft noise texture overlay */
    background: radial-gradient(circle at 50% 50%, rgba(11, 9, 20, 0) 0%, rgba(11, 9, 20, 0.8) 100%);
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.6;
    animation: drift 15s infinite alternate ease-in-out;
    mix-blend-mode: screen;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--blob-1);
    top: -150px;
    left: -150px;
    animation-duration: 20s;
}

.shape-2 {
    width: 600px;
    height: 600px;
    background: var(--blob-2);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
    animation-duration: 25s;
}

/* Add a third shape via CSS */
.background-elements::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--blob-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 10s infinite alternate ease-in-out;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { transform: translate(80px, 60px) scale(1.1) rotate(10deg); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    z-index: 1;
    perspective: 1000px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header p {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

input:focus {
    border-color: var(--input-focus);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fix for Chrome autofill dark mode */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px rgba(20, 18, 28, 0.8) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.submit-btn {
    margin-top: 12px;
    width: 100%;
    padding: 16px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

/* Button hover reflection effect */
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.submit-btn:hover::before {
    left: 200%;
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

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

.spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--btn-text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
}

.submit-btn.loading .spinner {
    opacity: 1;
}

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

.error-message {
    padding-top: 8px;
    color: var(--error-color);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    height: 0;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    height: auto;
}