:root {
    color-scheme: light;
    --color-ink: #20302d;
    --color-muted: #71807b;
    --color-primary: #287c68;
    --color-primary-dark: #1d6253;
    --color-primary-soft: #e8f4ef;
    --color-surface: #ffffff;
    --color-border: #e4ece8;
    --shadow-card: 0 18px 50px rgba(32, 63, 53, 0.08);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: #f4f8f6;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 48px 24px 112px;
    color: var(--color-ink);
    background:
        radial-gradient(ellipse at 90% 0%, rgba(201, 232, 218, 0.5), transparent 34rem),
        #f4f8f6;
    line-height: 1.7;
}

header,
main {
    width: min(100%, 760px);
    margin-inline: auto;
}

header {
    margin-bottom: 28px;
    text-align: center;
}

header h1 {
    margin: 0;
    color: #1b4037;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 750;
    letter-spacing: -0.04em;
    line-height: 1.35;
}

#egypt-clock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 7px 14px;
    border: 1px solid #dcebe3;
    border-radius: 999px;
    color: var(--color-primary-dark);
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    font-weight: 600;
}

main {
    display: grid;
    gap: 20px;
}

main > section {
    padding: clamp(22px, 5vw, 34px);
    border: 1px solid rgba(220, 233, 226, 0.9);
    border-radius: 22px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

main h2 {
    margin: 0 0 20px;
    color: #29473f;
    font-size: 1.2rem;
    font-weight: 700;
}

form {
    display: grid;
    gap: 14px;
}

label {
    margin-bottom: -8px;
    color: #53645e;
    font-size: 0.94rem;
    font-weight: 600;
}

input,
select,
button {
    min-height: 48px;
    border-radius: 12px;
    font: inherit;
}

input,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    outline: none;
    color: var(--color-ink);
    background: #fbfdfc;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
    color: #9aa8a2;
}

input:focus,
select:focus {
    border-color: #69a995;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(40, 124, 104, 0.11);
}

button {
    padding: 10px 20px;
    border: 0;
    color: #fff;
    background: var(--color-primary);
    box-shadow: 0 7px 16px rgba(40, 124, 104, 0.18);
    cursor: pointer;
    font-weight: 700;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 9px 20px rgba(40, 124, 104, 0.23);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #8cc9b4;
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.account-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.account-bar strong {
    color: var(--color-ink);
}

.secondary-button {
    border: 1px solid #d5e5dd;
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
    box-shadow: none;
}

.secondary-button:hover {
    color: #174e42;
    background: #dcefe6;
    box-shadow: none;
}

.auth-panel > p {
    margin: -10px 0 20px;
    color: var(--color-muted);
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-actions button {
    flex: 1;
}

.feedback {
    margin: 0;
    color: var(--color-primary-dark);
    font-size: 0.92rem;
}

.feedback:empty {
    display: none;
}

.feedback[data-state="error"] {
    color: #a53d3d;
}

#app-content > section {
    margin-top: 20px;
    padding: clamp(22px, 5vw, 34px);
    border: 1px solid rgba(220, 233, 226, 0.9);
    border-radius: 22px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

#daily-form {
    grid-template-columns: minmax(0, 1fr) 54px;
    align-items: center;
}

#daily-form button {
    padding: 0;
    font-size: 1.5rem;
}

#daily-tasks-list,
#quick-reminders-list {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

#daily-tasks-list li,
#quick-reminders-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #fbfdfc;
}

.task-label {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.task-label input {
    width: 18px;
    min-width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary);
}

.task-label input:checked + span {
    color: var(--color-muted);
    text-decoration: line-through;
}

#quick-reminders-list li > span,
.project-card > span {
    display: grid;
}

#quick-reminders-list small,
.project-card small {
    color: var(--color-muted);
    font-size: 0.84rem;
}

.item-delete {
    min-height: 36px;
    padding: 5px 11px;
    border: 1px solid #f0dada;
    color: #a53d3d;
    background: #fff8f8;
    box-shadow: none;
    font-size: 0.84rem;
}

.item-delete:hover {
    background: #ffeded;
    box-shadow: none;
}

.empty-state {
    color: var(--color-muted);
    text-align: center;
}

#long-term-form {
    margin-bottom: 20px;
}

#projects-container {
    display: grid;
    gap: 12px;
}

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #fbfdfc;
}

.bottom-nav {
    position: fixed;
    z-index: 10;
    right: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    width: min(calc(100% - 32px), 540px);
    justify-content: space-around;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(225, 235, 230, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 36px rgba(32, 63, 53, 0.14);
    transform: translateX(50%);
    backdrop-filter: blur(14px);
}

.bottom-nav a {
    flex: 1;
    padding: 9px 10px;
    border-radius: 12px;
    color: var(--color-muted);
    text-align: center;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 650;
    transition: color 160ms ease, background 160ms ease;
}

.bottom-nav a:hover {
    color: var(--color-primary-dark);
    background: #f3f8f5;
}

.bottom-nav a.active {
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
}

@media (min-width: 640px) {
    body {
        padding-top: 64px;
    }

    #reminder-form {
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }

    #reminder-form label {
        grid-column: 1 / -1;
        margin-bottom: -8px;
    }

    #reminder-form button {
        grid-column: 1 / -1;
    }

    #long-term-form {
        grid-template-columns: minmax(0, 1fr) 190px auto;
        align-items: center;
    }
}

@media (max-width: 420px) {
    body {
        padding: 32px 16px 104px;
    }

    main > section {
        border-radius: 18px;
    }

    .bottom-nav a {
        padding-inline: 5px;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
