/* --- Modern Variable Palette --- */
:root {
    --primary: #6366f1;
    --primary-light: #e0e7ff;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease-in-out;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
}

/* --- Layout Container --- */
.container {
    width: 100%;
    max-width: 480px;
    padding: 0 20px;
    flex: 1;
}

/* --- Cards & Elements --- */
.project-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.auth-card {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-top: 15vh;
    text-align: center;
}

/* --- Inputs & Buttons --- */
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    background: #fff;
    color: var(--text-main);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
}

/* --- Task Items --- */
.task-item {
    display: flex;
    align-items: flex-start; /* Aligns checkbox with the first line of text */
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
    width: 100%;
}

.task-item span {
    font-size: 0.95rem;
    line-height: 1.4;  /* Comfortable reading height */
    word-break: break-word; /* Prevents long URLs or words from breaking the layout */
    color: var(--text-main);
    flex: 1; /* Takes up all remaining space */
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;  /* Prevents narrowing */
    min-height: 22px; /* Prevents flattening */
    flex-shrink: 0;   /* Forces the checkbox to maintain its size */
    
    border-radius: 6px;
    border: 2px solid var(--border);
    appearance: none;
    background: #fff;
    cursor: pointer;
    position: relative;
    margin-top: 2px;  /* Manual tweak to center with the first line of text */
}

input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    color: white;
    font-size: 14px;
    left: 4px;
    top: -1px;
}

/* --- Modals --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: flex-end;
    /* Mobile feel: slide from bottom */
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* --- Utilities --- */
.header-nav h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logout-link:hover {
    color: #ef4444;
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}