html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    /* Fallback */
    min-height: 100dvh;
    /* Modern mobile fix */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow-x: hidden;
}

.container {
    text-align: center;
}

.welcome-text {
    font-size: 3rem;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out forwards;
    margin-bottom: 2rem;
}

.auth-buttons {
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.5s forwards;
    /* Delay the buttons slightly */
}

.btn {
    padding: 10px 30px;
    font-size: 1.2rem;
    margin: 0 10px;
    cursor: pointer;
    background-color: transparent;
    color: black;
    border: 2px solid black;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: black;
    color: white;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    /* White background */
    margin: 5% auto;
    padding: 40px;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    /* More rounded */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
    position: relative;
    animation: modalScaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    /* Bouncy effect */
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close {
    color: #888;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: normal;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: black;
}

h2 {
    margin: 0 0 10px 0;
    font-weight: 600;
    font-size: 1.8rem;
    color: #333;
}

.subtitle {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.social-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 30px;
    /* Pill shape */
    background-color: transparent;
    color: black;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
    font-family: inherit;
}

.social-btn:hover {
    background-color: #f0f0f0;
}

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #666;
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 10px;
}

.auth-input {
    width: 100%;
    padding: 14px;
    /* Slightly larger padding */
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 8px;
    /* Slightly rounded corners */
    box-sizing: border-box;
    background-color: transparent;
    color: black;
    font-size: 1rem;
}

.auth-input:focus {
    outline: none;
    border-color: #2b7de9;
    /* Blue accent on focus */
}

.submit-btn {
    width: 100%;
    background-color: #3b82f6;
    /* Nice blue */
    color: white;
    border: none;
    padding: 12px;
    margin-top: 25px;
    border-radius: 30px;
    /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #2563eb;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .welcome-text {
        font-size: 2rem;
        padding: 0 10px;
        text-align: center;
        width: 100%;
    }

    .container {
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 300px;
        /* Prevent buttons from getting too wide on tablets */
        margin: 0 auto;
    }


    .btn {
        width: 100%;
        margin: 0;
        /* Remove horizontal margin */
        padding: 12px 0;
        /* Larger touch target */
    }

    .modal-content {
        width: 85%;
        margin: 20% auto;
        padding: 30px 20px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }
}

/* CSS Variables for Theme Colors */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --modal-bg: #ffffff;
    --input-bg: transparent;

    /* Light Mode Toggle Colors (Reference Match) */
    --toggle-bg: #FDEAD8;
    /* Creamy beige background */
    --toggle-circle: #FDB813;
    /* Golden sun color */
    --toggle-icon: #ffffff;
    /* Icon color */

    --glow-color: rgba(255, 180, 0, 0.15);
    /* Warm glow for light mode */

    --button-bg: transparent;
    --button-text: black;
    --button-border: black;
    --button-hover-bg: black;
    --button-hover-text: white;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #000000;
    /* Pure black background for verified "black website" feel */
    --text-color: #ffffff;
    --modal-bg: #1a1a1a;
    --input-bg: #333333;
    --input-border: #444;

    /* Dark Mode Toggle Colors (Reference Match) */
    --toggle-bg: #1a2230;
    /* Dark navy background */
    --toggle-circle: #2196F3;
    /* Bright blue moon color */
    --toggle-icon: #ffffff;

    --glow-color: rgba(33, 150, 243, 0.15);
    /* Blue glow for dark mode */

    --button-bg: transparent;
    --button-text: white;
    --button-border: white;
    --button-hover-bg: white;
}





/* Ensure content is above glow/canvas */
.container,
.theme-switch,
.modal {
    z-index: 1;
    position: relative;
}

/* Update existing elements to use variables */
.btn {
    color: var(--button-text);
    border-color: var(--button-border);
    background-color: var(--button-bg);
}

.btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

.modal-content {
    background-color: var(--modal-bg);
    color: var(--text-color);
    border-color: var(--input-border);
}

.close {
    color: var(--text-color);
}

.close:hover {
    color: #ff5555;
    /* distinct hover color for close */
}

h2 {
    color: var(--text-color);
}

.subtitle {
    color: #888;
}

/* Dark mode specific adjustments for subtitle if needed */
[data-theme="dark"] .subtitle {
    color: #aaa;
}

.social-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--input-border);
    border-radius: 30px;
    /* Pill shape */
    background-color: transparent;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
    font-family: inherit;
}

.social-btn:hover {
    background-color: var(--input-bg);
}

.auth-input {
    border-color: var(--input-border);
    color: var(--text-color);
    background-color: var(--input-bg);
}

.auth-input::placeholder {
    color: #888;
}

/* Toggle Switch Styles - Reimagined for "Premium" Look */
.theme-switch {
    position: fixed;
    /* Fixed to viewport so it never moves */
    top: 25px;
    right: 25px;
    display: inline-block;
    width: 70px;
    /* Slightly wider for pill shape */
    height: 36px;
    /* Slightly taller */
    z-index: 1000;
    /* Ensure it's above everything */
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg);
    transition: 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 36px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Inner shadow for depth */
}

.circle {
    position: absolute;
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
    background-color: var(--toggle-circle);
    transition: 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Drop shadow on the knob */
}

/* Icon Styles */
.sun-icon,
.moon-icon {
    width: 16px;
    height: 16px;
    stroke: var(--toggle-icon);
    stroke-width: 2.5;
    fill: none;
    position: absolute;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
    transition: 0.4s;
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
    transition: 0.4s;
}

/* Checked State (Dark Mode) */
input:checked+.slider {
    background-color: var(--toggle-bg);
}

input:checked+.slider .circle {
    transform: translateX(34px);
    background-color: var(--toggle-circle);
}

input:checked+.slider .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

input:checked+.slider .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}