:root {
    /* Light Mode Variables */
    --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e1e8ed 100%);
    --blob-1: #4ca1af;
    --blob-2: #c4e0e5;
    --blob-3: #89b0ae;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-main: #2c3e50;
    --text-muted: #546e7a;
    --input-bg: rgba(255, 255, 255, 0.6);
    --input-border: rgba(255, 255, 255, 0.8);
    --input-focus: rgba(255, 255, 255, 0.9);
    --btn-primary-bg: #2980b9;
    --btn-primary-hover: #3498db;
    --btn-text: #ffffff;
    --error-bg: rgba(231, 76, 60, 0.2);
    --error-text: #c0392b;
}

[data-theme="dark"] {
    /* Dark Mode Variables - Premium Slate/Blue for financial apps */
    --bg-gradient: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    --blob-1: #00d2ff;
    --blob-2: #3a7bd5;
    --blob-3: #1cb5e0;
    --glass-bg: rgba(16, 24, 32, 0.45);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f5f7fa;
    --text-muted: #b0bec5;
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: rgba(0, 0, 0, 0.4);
    --btn-primary-bg: #00b4db;
    --btn-primary-hover: #0083b0;
    --btn-text: #ffffff;
    --error-bg: rgba(231, 76, 60, 0.3);
    --error-text: #ff8a80;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: background 0.5s ease-in-out;
    color: var(--text-main);
}

/* Background Animated Blobs (Liquid Form) */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--blob-1);
    top: -100px;
    left: -100px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--blob-2);
    bottom: -50px;
    right: -50px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-delay: -2s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--blob-3);
    bottom: -150px;
    left: 20%;
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1) rotate(0deg); }
    50% { transform: translateY(-30px) scale(1.1) rotate(10deg); }
    100% { transform: translateY(0px) scale(1) rotate(0deg); }
}

/* Liquid Glass Card */
.login-container {
    perspective: 1000px;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 30px;
    transition: all 0.3s ease;
    /* Subtle reflective top inner shadow */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 40px 0 rgba(0, 0, 0, 0.2);
}

.card-header {
    text-align: center;
}

.card-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 12px;
}

.card-header p {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

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

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

.input-group label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Base input styling applies to all text/password inputs */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    background: var(--input-focus);
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--btn-primary-bg);
    color: var(--btn-text);
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

/* Theme Toggle Wrapper */
.theme-switch-wrapper {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    z-index: 10;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
}

.slider .icon-light, .slider .icon-dark {
    font-size: 14px;
    line-height: 1;
}

.slider:before {
    background-color: var(--text-main);
    bottom: 4px;
    content: "";
    height: 24px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 24px;
    z-index: 2;
}

input:checked + .slider {
    background-color: rgba(0, 0, 0, 0.3);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}
