:root {
    --primary: #6366f1; /* Indigo */
    --primary-dark: #4f46e5;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text: #1f2937;
    --border: #e5e7eb;
    --success: #10b981;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 0; }

/* Authentication Pages */
.auth-container { display: flex; justify-content: center; align-items: center; height: 100vh; padding: 20px; }
.auth-box { background: var(--card-bg); padding: 2rem; border-radius: 1rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; }
.auth-box h2 { margin-bottom: 1.5rem; color: var(--primary); }
input, select { width: 100%; padding: 0.75rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 0.5rem; font-size: 1rem; box-sizing: border-box;}
button { width: 100%; padding: 0.75rem; background: var(--primary); color: white; border: none; border-radius: 0.5rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
button:hover { background: var(--primary-dark); }

/* Dashboard Header */
.header { background: var(--card-bg); padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
.header h1 { font-size: 1.25rem; margin: 0; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; width: auto; }

/* Grid Layout for Habits */
.container { padding: 1rem; max-width: 800px; margin: 0 auto; }
.habit-grid { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 80px; }

.habit-card { background: var(--card-bg); border-radius: 0.75rem; padding: 1rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.habit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.habit-title { font-weight: 600; font-size: 1.1rem; }
.streak-badge { background: #fee2e2; color: #b91c1c; padding: 0.25rem 0.5rem; border-radius: 99px; font-size: 0.75rem; font-weight: bold; }

/* The Days Row (Scrollable) */
.days-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
.day-col { display: flex; flex-direction: column; align-items: center; min-width: 45px; }
.day-label { font-size: 0.75rem; color: #6b7280; margin-bottom: 4px; }

/* Custom Checkbox */
.check-circle { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; background: #fff; }
.check-circle.completed { background: var(--success); border-color: var(--success); color: white; }
.check-circle:active { transform: scale(0.9); }

/* Floating Add Button */
.fab { position: fixed; bottom: 2rem; right: 2rem; width: 56px; height: 56px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); cursor: pointer; text-decoration: none; }

/* Password Eye Icon Styles */
.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper input {
    width: 100%;
    padding-right: 40px; /* Make space for the icon */
}
.password-toggle {
    position: absolute;
    right: 15px;
    top: 38%; /* Adjust vertical alignment */
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    font-size: 1.1rem;
    z-index: 10;
}

/* --- FIXED CALENDAR STYLES --- */

/* Controls (Month/Year) */
.calendar-controls { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    background: #fff; 
    padding: 10px; 
    border-radius: 12px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
}
.calendar-controls select { 
    background: #f9f9f9; 
    border: 1px solid #eee; 
    border-radius: 6px;
    padding: 5px; 
    font-size: 0.9rem;
    cursor: pointer;
}
.cal-btn { 
    text-decoration: none; 
    color: var(--text); 
    font-size: 1.2rem; 
    padding: 5px 15px; 
    background: #eee;
    border-radius: 6px;
}

/* The Grid Container */
.calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); /* Force 7 Columns */
    gap: 5px; /* Smaller gap for mobile */
    background: #fff; 
    padding: 10px; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Header (Sun, Mon...) */
.cal-header { 
    font-weight: 700; 
    text-align: center; 
    color: #888; 
    font-size: 0.75rem; /* Smaller font */
    text-transform: uppercase;
    padding-bottom: 8px;
}

/* Day Cells */
.cal-day { 
    aspect-ratio: 1 / 1; /* Keeps them square */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; /* Make them circles */
    font-size: 0.9rem; 
    cursor: pointer; 
    background: #fff; 
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

/* States */
.cal-day.completed { 
    background: var(--success); 
    color: white; 
    border-color: var(--success); 
}
.cal-day.today { 
    border: 2px solid var(--primary); 
    color: var(--primary);
    font-weight: bold; 
}
.cal-day.today.completed {
    color: white;
    border-color: var(--primary-dark);
}
.cal-day.empty { 
    background: transparent; 
    border: none; 
    cursor: default; 
}