:root {
    --pink:        #FFB7C5;
    --pink-light:  #FFE0E9;
    --mint:        #B5EAD7;
    --lavender:    #C7CEEA;
    --peach:       #FFDAC1;
    --bg:          #FFF5F8;
    --text:        #5C4B6B;
    --text-light:  #9B8AAB;
    --white:       #FFFFFF;
    --shadow:      0 4px 12px rgba(200, 150, 180, 0.18);
    --radius:      16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Nav ── */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 0 1.5rem;
}

nav {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo { font-size: 1.3rem; font-weight: 800; }

.nav-links { display: flex; gap: 1.5rem; }

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ── Main layout ── */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ── Page header ── */
.page-header { text-align: center; margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.4rem; }
.date { color: var(--text-light); }
.progress-summary { margin-top: 0.6rem; font-size: 1.1rem; font-weight: 700; }

/* ── Sections ── */
.habit-section { margin-bottom: 2rem; }
.habit-section h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* ── Habit cards ── */
.habit-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }

.habit-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.15s;
}
.habit-card:hover { transform: translateY(-2px); }
.habit-card.completed { background: var(--mint); opacity: 0.85; }

.habit-info { display: flex; flex-direction: column; gap: 0.15rem; }
.habit-name { font-weight: 700; font-size: 1.05rem; }
.habit-card.completed .habit-name { text-decoration: line-through; }
.habit-desc { color: var(--text-light); font-size: 0.88rem; }
.habit-freq { color: var(--text-light); font-size: 0.8rem; font-style: italic; }

.habit-actions { display: flex; gap: 0.5rem; align-items: center; }

.checkmark { font-size: 1.4rem; color: #4caf7d; }

/* ── Buttons ── */
.btn {
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.12); }

.btn-complete  { background: var(--pink);     color: var(--text); }
.btn-primary   { background: var(--pink);     color: var(--text); }
.btn-secondary { background: var(--lavender); color: var(--text); }
.btn-qr        { background: var(--peach);    color: var(--text); }
.btn-danger    { background: #ffb3b3;         color: #8b0000; }
.btn-undo      { background: #e8e0f0;         color: var(--text-light); }
.btn-sm        { padding: 0.35rem 0.8rem; font-size: 0.85rem; }

/* ── Habits management page ── */
.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.habits-header h1 { font-size: 1.8rem; font-weight: 800; }

/* ── Forms ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}
.card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 700; margin-bottom: 0.4rem; font-size: 0.95rem; }

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--pink-light);
    border-radius: var(--radius);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--pink);
}
textarea { resize: vertical; min-height: 80px; }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* ── QR page ── */
.qr-container {
    text-align: center;
    padding: 1rem;
}
.qr-container h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.5rem; }
.qr-container img {
    max-width: 260px;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 1.5rem auto;
    display: block;
}

/* ── Complete / QR scan result ── */
.complete-container {
    text-align: center;
    padding: 3rem 1rem;
}
.complete-container .big-emoji { font-size: 4rem; margin-bottom: 1rem; }
.complete-container h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.complete-container p { color: var(--text-light); font-size: 1.1rem; margin-bottom: 0.5rem; }
.complete-container .btn { margin-top: 1.5rem; }

/* ── History page ── */
.history-day {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}
.history-day-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.history-empty { color: var(--text-light); font-style: italic; font-size: 0.9rem; }
.history-habits { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.history-tag {
    background: var(--mint);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
}

/* ── Mobile ── */
@media (max-width: 500px) {
    .page-header h1 { font-size: 1.6rem; }
    .habit-card { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .habit-actions { width: 100%; justify-content: flex-end; }
}
