/* Login / forgot / reset — load after tokens.css + style.css */

/* ==========================================
   Login Page
   ========================================== */

.login-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.login-container {
    display: grid;
    grid-template-columns: 40% 60%;
    width: 100%;
    height: 100%;
}

.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
}

.login-form-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-header {
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: var(--spacing-xl);
}

.login-logo .logo-image {
    height: 50px;
    width: auto;
    transition: filter 0.3s ease;
}

/* Make logo white in dark theme */
[data-theme="dark"] .login-logo .logo-image {
    filter: brightness(0) invert(1);
}

/* Keep logo normal in light theme */
[data-theme="light"] .login-logo .logo-image {
    filter: none;
}

.login-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.alert-message {
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #ef4444;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.alert-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #ef4444;
}

.alert-message.alert-success {
    background: rgba(0, 191, 165, 0.12);
    border-color: rgba(0, 191, 165, 0.28);
    color: #0f766e;
}

.alert-message.alert-success svg {
    stroke: #0f766e;
}

.login-form-intro {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-secondary, #4b5563);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
}

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

.input-wrapper input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 116, 212, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 28px;
    height: 28px;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    transition: stroke 0.2s ease;
}

.password-toggle:hover svg {
    stroke: var(--text-primary);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: transparent;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
}

/* Primary button base lives in style.css (SHELL_CSS). Login adds a soft hover sheen. */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-full {
    width: 100%;
}

/* Login button: left-aligned, reasonable width */
.login-form .login-submit-btn {
    align-self: flex-start;
    width: auto;
    min-width: 10rem;
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-loading:not(.hidden) {
    display: flex;
}

.spinner {
    animation: spin 1s linear infinite;
    width: 20px;
    height: 20px;
}

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

.form-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.form-footer a:hover {
    color: var(--primary-hover);
}

.login-version {
    margin-top: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ==========================================
   Login Hero Section
   ========================================== */

.login-hero-section {
    background: var(--bg-primary);
    background-image: url('../img/loginbg.webp');
    background-size: cover;
    background-position: center center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-xl) 3rem;
}

.login-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(160deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 560px;
    width: 100%;
    padding: var(--spacing-3xl);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xl);
    backdrop-filter: blur(10px);
    color: #ffffff;
}

.hero-badge svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent-color);
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content > p {
    font-size: 1.125rem;
    color: #ffffff;
    margin-bottom: var(--spacing-xl);
    line-height: 1.8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.feature-item svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-color);
    flex-shrink: 0;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.stat-item p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-shapes {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

[data-theme="dark"] .shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

[data-theme="dark"] .shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

[data-theme="dark"] .shape-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

[data-theme="light"] .shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

[data-theme="light"] .shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(33, 150, 243, 0.4) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

[data-theme="light"] .shape-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 188, 212, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@media (max-width: 1200px) {
    .login-container {
        grid-template-columns: 45% 55%;
    }
}

@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
    }
    
    .login-hero-section {
        display: none;
    }
}


[data-theme="light"] .login-form-section {
    background: #ffffff;
}

/* Adjust hero section for light theme */
[data-theme="light"] .login-hero-section {
    background: #ffffff;
    background-image: url('../img/loginbg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

[data-theme="light"] .login-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.67) 0%, rgba(255, 255, 255, 0) 50%);
    z-index: 1;
}

[data-theme="light"] .hero-content {
    position: relative;
    z-index: 2;
}

[data-theme="light"] .hero-content h2 {
    color: #000000;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .hero-content > p {
    color: #1a1a1a;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .hero-badge {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000000;
}

[data-theme="light"] .feature-item {
    color: #1a1a1a;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .stat-item h3 {
    color: #000000;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .stat-item p {
    color: #4a4a4a;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .hero-stats {
    border-top-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .shape {
    opacity: 0.1;
}

/* Dark theme hero with image */
[data-theme="dark"] .login-hero-section {
    background: #000000;
    background-image: url('../img/loginbg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
}

[data-theme="dark"] .login-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.67) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

[data-theme="dark"] .hero-content {
    position: relative;
    z-index: 2;
}

[data-theme="dark"] .login-form-section {
    background: #0f0f0f;
}
