/* ============================================
   CLEAN WHITE LOGIN THEME - Trello Inspired
   NeuraPM Premium SaaS Design
   ============================================ */

/* ============================================
   VARIABLES & RESET
   ============================================ */

:root {
    /* Color Palette */
    --white: #FFFFFF;
    --background: #F7F9FB;
    --surface: #E9EDF2;
    --text-primary: #0F172A;
    --text-secondary: #1E293B;
    --text-tertiary: #4B5563;
    --text-muted: #6B7280;
    --accent: #00D3C0;
    --accent-hover: #00BDB0;
    --border: #D8DEE6;
    --border-focus: #00D3C0;
    --error: #EF4444;
    --success: #10B981;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-focus: 0 0 0 4px rgba(0, 211, 192, 0.15);
    --shadow-glow: 0 0 16px rgba(0, 211, 192, 0.35);

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --white: #1E1E2E;
    --background: #11111B;
    --surface: #313244;
    --text-primary: #CDD6F4;
    --text-secondary: #BAC2DE;
    --text-tertiary: #A6ADC8;
    --text-muted: #6C7086;
    --accent: #00D3C0;
    --accent-hover: #00E5D0;
    --border: #45475A;
    --border-focus: #00D3C0;
    --error: #F38BA8;
    --success: #A6E3A1;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-focus: 0 0 0 4px rgba(0, 211, 192, 0.25);
    --shadow-glow: 0 0 20px rgba(0, 211, 192, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 460px 1fr;
    min-height: 100vh;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
}

/* ============================================
   ILLUSTRATION AREAS
   ============================================ */

.illustration-left,
.illustration-right {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.illustration-left {
    animation-delay: 0.2s;
}

.illustration-right {
    animation-delay: 0.4s;
}

.floating-element {
    width: 100%;
    max-width: 400px;
    animation: float 6s ease-in-out infinite;
}

.floating-element svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(var(--shadow-sm));
}

/* SVG Hover Animations */
.floating-element:hover svg {
    animation: gentleBounce 0.6s ease;
}

.team-illustration,
.productivity-illustration {
    transform-origin: center;
}

.floating-element:hover .team-illustration,
.floating-element:hover .productivity-illustration {
    animation: scaleUp 0.3s ease forwards;
}

/* ============================================
   LOGIN CARD
   ============================================ */

.login-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.1s;
}

.login-card {
    background: var(--white);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 460px;
    transition: var(--transition-smooth);
}

.login-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   LOGO & HEADER
   ============================================ */

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotateIn 0.5s ease;
}

.logo-icon svg {
    transition: var(--transition-fast);
}

.logo-icon:hover svg {
    transform: scale(1.1) rotate(5deg);
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.tagline {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin: 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-input:hover {
    border-color: var(--border-focus);
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
}

.form-input:focus::placeholder {
    opacity: 0.5;
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--accent);
}

/* ============================================
   CHECKBOX & FORGOT PASSWORD ROW
   ============================================ */

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border: solid white;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.checkbox-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.forgot-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}

.forgot-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition-fast);
}

.forgot-link:hover::after {
    width: 100%;
}

/* ============================================
   CAPTCHA
   ============================================ */

.captcha-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.captcha-display {
    flex: 1;
    background: linear-gradient(135deg, #F7F9FB 0%, #E9EDF2 100%);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--text-secondary);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.captcha-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 211, 192, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.captcha-text {
    position: relative;
    z-index: 1;
}

.captcha-refresh {
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    color: var(--text-tertiary);
}

.captcha-refresh:hover {
    background: var(--background);
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(180deg);
}

.captcha-refresh:active {
    transform: rotate(180deg) scale(0.95);
}

/* ============================================
   PRIMARY BUTTON
   ============================================ */

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.arrow-icon {
    transition: var(--transition-fast);
}

.btn-primary:hover .arrow-icon {
    transform: translateX(4px);
}

/* Ripple Effect */
.btn-primary::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.btn-primary:active::after {
    animation: ripple 0.6s ease-out;
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface);
}

/* ============================================
   SSO BUTTONS
   ============================================ */

.sso-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-sso {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-sso svg {
    transition: var(--transition-fast);
}

.btn-sso:hover {
    background: #F7FAFB;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-sso:hover svg {
    transform: scale(1.1);
}

.btn-sso:active {
    transform: translateY(0);
}

/* ============================================
   FOOTER LINKS
   ============================================ */

.form-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    padding-top: 0.5rem;
}

.footer-text {
    margin-right: 0.5rem;
}

.footer-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-hover);
}

.footer-link:hover::after {
    width: 100%;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .login-wrapper {
        grid-template-columns: 0.8fr 460px 0.8fr;
        gap: 2rem;
    }

    .floating-element {
        max-width: 300px;
    }
}

@media (max-width: 968px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .illustration-left,
    .illustration-right {
        display: none;
    }

    .login-card {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .logo-text {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 0.9375rem;
    }

    .sso-buttons {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FORM VALIDATION STATES
   ============================================ */

.form-input:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

.form-input:valid:not(:placeholder-shown) {
    border-color: var(--success);
}

.form-input:invalid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary:focus-visible,
.btn-sso:focus-visible,
.form-input:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    position: absolute;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle .sun-icon {
    color: #F59E0B;
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-toggle .moon-icon {
    color: #6366F1;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* Dark mode icon states */
[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Sun rays animation */
.theme-toggle:hover .sun-icon {
    animation: sunPulse 0.6s ease-in-out;
}

[data-theme="dark"] .theme-toggle:hover .moon-icon {
    animation: moonGlow 0.6s ease-in-out;
}

@keyframes sunPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
}

@keyframes moonGlow {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 0 transparent);
    }
    50% {
        transform: scale(1.15) rotate(-15deg);
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
    }
}

/* Dark theme specific overrides */
[data-theme="dark"] .captcha-display {
    background: linear-gradient(135deg, #1E1E2E 0%, #313244 100%);
}

[data-theme="dark"] .btn-sso:hover {
    background: #313244;
}

/* Smooth theme transition for all elements */
body,
.login-card,
.form-input,
.btn-sso,
.captcha-display,
.captcha-refresh,
.checkbox-custom,
.theme-toggle {
    transition: background-color 0.4s ease, 
                border-color 0.4s ease, 
                color 0.4s ease,
                box-shadow 0.4s ease;
}
