:root {
    --primary-color: #90D1B7;
    --primary-hover: #7BC4A8;
    --secondary-color: #6FBE9A;
    --background-gradient-start: #1e293b;
    --background-gradient-end: #334155;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background-gradient-start) 0%, var(--background-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    overflow: hidden;
    position: relative;
}

.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    border-radius: 38% 62% 63% 37% / 70% 33% 67% 30%;
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    top: 50%;
    left: 80%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
    }
    50% {
        transform: translateY(0) rotate(180deg);
    }
    75% {
        transform: translateY(20px) rotate(270deg);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--card-border);
    padding: 48px 40px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.login-title {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0 4px;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -8px;
    font-size: 12px;
    color: var(--primary-color);
    background: transparent;
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-input:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.checkbox-input:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-input:checked::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Fallback checkmark using Unicode character */
.checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    display: none; /* Hidden by default, shown if CSS checkmark fails */
}

/* Show Unicode checkmark on older browsers */
@supports not (border-width: 0 2px 2px 0) {
    .checkbox-input:checked::before {
        display: none;
    }
    .checkbox-input:checked::after {
        display: block;
    }
}

.checkbox-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: shake 0.5s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message svg {
    flex-shrink: 0;
    min-width: 20px;
}

.error-message div {
    flex: 1;
}

.error-message span {
    color: #ef4444;
    display: block;
}

.error-message .text-danger {
    color: #ef4444;
    margin: 0;
}

.error-message ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-message li {
    color: #ef4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.validation-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 14px;
    }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Password visibility toggle */
.password-group {
    position: relative;
}

.password-group .form-input {
    padding-right: 90px; /* Make room for both icons */
}

.password-toggle {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.password-toggle:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.eye-icon {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.password-group .input-icon {
    right: 20px;
    pointer-events: none;
}