/* ================================================
   Controle de Hábitos - Design System v3
   Premium, modern, mobile-first
   ================================================ */

/* === CSS VARIABLES === */
:root {
    /* Core palette */
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --primary-alpha-10: rgba(99, 102, 241, 0.1);
    --primary-alpha-20: rgba(99, 102, 241, 0.2);

    --success: #10B981;
    --success-dark: #059669;
    --success-light: #34D399;
    --success-alpha-10: rgba(16, 185, 129, 0.1);
    --success-alpha-20: rgba(16, 185, 129, 0.2);

    --warning: #F59E0B;
    --warning-dark: #D97706;
    --warning-light: #FBBF24;
    --warning-alpha-10: rgba(245, 158, 11, 0.1);

    --danger: #EF4444;

    /* Neutrals */
    --bg-body: #F0F2F5;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-subtle: #F8FAFC;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    --border-light: #E2E8F0;
    --border-subtle: #F1F5F9;

    /* Spacing & Shape */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.25);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.25s;
    --duration-slow: 0.4s;
}

/* === RESET === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: all var(--duration-normal) var(--ease-out);
}

/* === APP SHELL === */
.app-shell {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* === HERO HEADER === */
.hero-header {
    position: relative;
    padding: 0 0 3rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: -20%;
    right: -20%;
    height: 100%;
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 30%, #818CF8 60%, #A78BFA 100%);
    border-radius: 0 0 40% 40%;
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-top-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-logout {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.btn-add-habit {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-add-habit:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.hero-greeting {
    text-align: center;
    margin-bottom: 1.75rem;
}

.hero-greeting h1 {
    font-size: 1.625rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

/* === PROGRESS RING === */
.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: -1.5rem;
}

.progress-ring {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.3));
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--success-light);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 0.8s var(--ease-out);
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.progress-percent {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.progress-label {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

/* === MAIN CONTENT === */
.main-content {
    padding: 0 1.25rem 2rem;
    position: relative;
    z-index: 2;
}

/* === PERIOD SELECTOR === */
.period-selector-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.period-selector {
    display: inline-flex;
    gap: 0;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    padding: 4px;
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.btn-period {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 1;
    position: relative;
    transition: color var(--duration-normal) var(--ease-out);
}

.btn-period.active {
    color: white;
}

.btn-period:hover:not(.active) {
    color: var(--text-primary);
}

.period-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-spring);
    z-index: 0;
    box-shadow: var(--shadow-primary);
}

/* === STATS CAROUSEL === */
.stats-carousel {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    margin-bottom: 1.75rem;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stats-carousel::-webkit-scrollbar {
    display: none;
}

.stats-carousel:empty {
    display: none;
}

.stat-card {
    flex-shrink: 0;
    min-width: 130px;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.04em;
}

.card-number-symbol {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 1px;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === DATE NAVIGATOR === */
.date-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding: 0.75rem 0;
}

.btn-nav {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
}

.btn-nav:hover {
    background: var(--primary-alpha-10);
    color: var(--primary);
    border-color: var(--primary-alpha-20);
    transform: scale(1.05);
}

.btn-nav:active {
    transform: scale(0.95);
}

.btn-nav svg {
    width: 18px;
    height: 18px;
}

.date-info {
    text-align: center;
    min-width: 180px;
}

.date-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: var(--primary);
}

#current-date-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.1rem;
}

/* === HABITS SECTION === */
.habits-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.habits-group {
    animation: fadeInUp var(--duration-slow) var(--ease-out);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.group-icon {
    font-size: 1rem;
}

.group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-alpha-10);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    margin-left: auto;
}

/* === HABIT CARDS (List Items) === */
.habit-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.habit-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.habit-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    transition: all var(--duration-normal) var(--ease-out);
}

.habit-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.habit-card:active {
    transform: translateX(2px) scale(0.995);
}

/* Done state */
.habit-card.done::before {
    background: var(--success);
}

.habit-card.done .habit-check {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.habit-card.done .habit-check svg {
    opacity: 1;
    transform: scale(1);
}

.habit-card.done .habit-name {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
    text-decoration-thickness: 1.5px;
}

/* Todo state */
.habit-card.todo::before {
    background: var(--warning);
}

.habit-card.todo:hover .habit-check {
    border-color: var(--success-light);
    background: var(--success-alpha-10);
}

/* Checkbox icon */
.habit-check {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-spring);
    background: var(--bg-subtle);
}

.habit-check svg {
    width: 16px;
    height: 16px;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--duration-normal) var(--ease-spring);
}

.habit-name {
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--duration-normal) var(--ease-out);
    flex-grow: 1;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* === DAILY SUMMARY === */
.daily-summary {
    margin-top: 2rem;
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
}

.summary-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.summary-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--success-light));
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.6s var(--ease-out);
}

.daily-summary p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-number {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.95rem;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 520px;
    padding: 1.5rem 1.5rem 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-spring);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Modal handle bar */
.modal-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    margin: 0 auto 1.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-alpha-10);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    color: var(--text-muted);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-subtle);
}

.btn-close svg {
    width: 22px;
    height: 22px;
}

/* Form */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    padding: 0.85rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--duration-normal) var(--ease-out);
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-alpha-10);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-cancel {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.btn-cancel:hover {
    color: var(--text-primary);
    background: var(--bg-subtle);
}

.btn-save {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-save:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-save:active {
    transform: translateY(0);
}

/* === FREQUENCY SELECTOR === */
.frequency-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.freq-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    background: var(--bg-subtle);
    transition: all var(--duration-normal) var(--ease-out);
    text-align: left;
}

.freq-btn:hover {
    border-color: var(--primary-alpha-20);
    background: var(--primary-alpha-10);
}

.freq-btn.active {
    border-color: var(--primary);
    background: var(--primary-alpha-10);
}

.freq-icon {
    font-size: 1.1rem;
}

.freq-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* === WEEKDAY SELECTOR === */
.weekday-selector {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.weekday-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-light);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-spring);
}

.weekday-btn:hover {
    border-color: var(--primary-alpha-20);
}

.weekday-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
    transform: scale(1.05);
}

/* === MONTHDAY SELECTOR === */
.monthday-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
}

.monthday-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-spring);
}

.monthday-btn:hover {
    border-color: var(--primary-alpha-20);
}

.monthday-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

/* === DATE RANGE (Temporary) === */
.date-range {
    display: flex;
    gap: 0.75rem;
}

.date-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-field input[type="date"] {
    padding: 0.7rem 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-subtle);
    transition: all var(--duration-normal) var(--ease-out);
    width: 100%;
}

.date-field input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-alpha-10);
}

/* === FREQUENCY BADGES === */
.habit-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.badge-freq {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-full);
    width: fit-content;
    letter-spacing: 0.2px;
}

.badge-semanal {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.badge-mensal {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-dark);
}

.badge-temporario {
    background: rgba(236, 72, 153, 0.1);
    color: #DB2777;
}

/* === EDIT & REACTIVATE BUTTONS === */
.btn-edit-habit,
.btn-reactivate {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--duration-normal) var(--ease-out);
    flex-shrink: 0;
}

.btn-edit-habit:hover {
    color: var(--primary);
    background: var(--primary-alpha-10);
}

.btn-reactivate {
    color: var(--success);
}

.btn-reactivate:hover {
    background: var(--success-alpha-10);
    color: var(--success-dark);
}

/* === EXPIRED HABIT CARD === */
.habit-card.expired {
    opacity: 0.6;
    border-style: dashed;
}

.habit-card.expired::before {
    background: var(--text-muted);
}

.habit-card.expired .habit-name {
    color: var(--text-muted);
}

.expired-check {
    background: var(--bg-subtle) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

.expired-check svg {
    opacity: 1 !important;
    transform: scale(1) !important;
    width: 16px;
    height: 16px;
}

/* === STAT CARD PROGRESS BAR === */
.card-progress {
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.35rem;
}

.card-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    transition: width 0.5s var(--ease-out);
}

.stat-card.stat-complete .card-progress-fill {
    background: var(--success);
}

.stat-card.stat-partial .card-progress-fill {
    background: var(--warning);
}

.stat-card.stat-complete {
    border-color: var(--success-alpha-20);
}

.stat-card.stat-complete .card-number {
    color: var(--success);
}

/* === RESPONSIVE === */
@media (min-width: 640px) {
    .modal-overlay {
        align-items: center;
    }

    .modal-content {
        border-radius: var(--radius-xl);
        max-width: 480px;
    }

    .modal-content::before {
        display: none;
    }
}

@media (max-width: 380px) {
    .hero-greeting h1 {
        font-size: 1.35rem;
    }

    .stat-card {
        min-width: 110px;
        padding: 0.9rem 1rem;
    }

    .frequency-selector {
        grid-template-columns: 1fr;
    }

    .weekday-btn {
        width: 38px;
        height: 38px;
        font-size: 0.65rem;
    }
}

/* === UTILITY ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.habit-card {
    animation: slideInRight var(--duration-normal) var(--ease-out) both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.habit-card:nth-child(1) {
    animation-delay: 0.02s;
}

.habit-card:nth-child(2) {
    animation-delay: 0.04s;
}

.habit-card:nth-child(3) {
    animation-delay: 0.06s;
}

.habit-card:nth-child(4) {
    animation-delay: 0.08s;
}

.habit-card:nth-child(5) {
    animation-delay: 0.10s;
}

.habit-card:nth-child(6) {
    animation-delay: 0.12s;
}

.habit-card:nth-child(7) {
    animation-delay: 0.14s;
}

.habit-card:nth-child(8) {
    animation-delay: 0.16s;
}

.habit-card:nth-child(9) {
    animation-delay: 0.18s;
}

.habit-card:nth-child(10) {
    animation-delay: 0.20s;
}

/* Hide empty groups */
.habits-group:has(.habit-list:empty) {
    display: none;
}