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

:root {
    color-scheme: dark;
    --bg: #080b10;
    --bg-soft: #0d121a;
    --panel: #111824;
    --panel-strong: #151f2d;
    --text: #edf5ff;
    --muted: #8ea0b8;
    --line: rgba(173, 196, 226, 0.16);
    --line-strong: rgba(173, 196, 226, 0.28);
    --ice: #9ad7ff;
    --ice-strong: #58c6ff;
    --green: #45e08b;
    --green-dim: rgba(69, 224, 139, 0.16);
    --red: #ff6b7a;
    --red-dim: rgba(255, 107, 122, 0.12);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    --radius: 22px;
    --radius-sm: 13px;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 10%, rgba(88, 198, 255, 0.14), transparent 28rem),
        radial-gradient(circle at 84% 0%, rgba(69, 224, 139, 0.09), transparent 24rem),
        linear-gradient(145deg, #07090d 0%, #0a0f16 52%, #07090d 100%);
    color: var(--text);
    direction: ltr;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
}

button,
input,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ice-strong);
    outline-offset: 3px;
}

.shell {
    min-height: 100vh;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 46px 46px;
}

.navbar {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand-mark {
    width: 18px;
    height: 18px;
    border: 1px solid var(--ice);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-shadow: 0 0 28px rgba(88, 198, 255, 0.45);
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 5px;
    background: var(--green);
    border-radius: 50%;
}

.nav-links {
    align-items: center;
    display: flex;
    gap: 12px;
}

.nav-user {
    color: var(--muted);
    font-size: 0.9rem;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

.eyebrow {
    color: var(--ice);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.btn {
    align-items: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--ice-strong), var(--green));
    color: #061017;
    box-shadow: 0 14px 36px rgba(88, 198, 255, 0.16);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.07);
}

.btn-sm {
    min-height: 34px;
    padding: 0 14px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.icon-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
    transition: 160ms ease;
}

.icon-button:hover {
    background: var(--red-dim);
    border-color: rgba(255, 107, 122, 0.32);
    color: var(--red);
}

.auth-screen {
    align-items: center;
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1fr) 420px;
    min-height: calc(100vh - 170px);
}

.auth-screen.single {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
}

.auth-copy {
    max-width: 620px;
}

.auth-copy h1 {
    font-size: clamp(2.6rem, 8vw, 6.2rem);
    letter-spacing: -0.075em;
    line-height: 0.98;
    margin: 12px 0 20px;
}

.auth-copy p:last-child {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 500px;
}

.auth-card,
.task-card,
.modal-panel,
.empty-state {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-card {
    padding: 28px;
}

.auth-card h2 {
    font-size: 1.55rem;
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.form-stack {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.form-row {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
}

.form-group label {
    color: var(--muted);
    display: block;
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 7px;
}

.form-group input,
.form-group textarea {
    background: rgba(5, 8, 13, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    display: block;
    min-height: 46px;
    padding: 10px 13px;
    width: 100%;
}

.form-group textarea {
    min-height: 94px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(142, 160, 184, 0.58);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(88, 198, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(88, 198, 255, 0.11);
    outline: none;
}

.jalali-datefield {
    position: relative;
}

.jalali-datefield-trigger {
    align-items: center;
    background: rgba(5, 8, 13, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 10px 13px;
    text-align: start;
    width: 100%;
}

.jalali-datefield-trigger:hover {
    border-color: var(--line-strong);
}

.jalali-datefield-trigger:focus-visible {
    border-color: rgba(88, 198, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(88, 198, 255, 0.11);
    outline: none;
}

.jalali-datefield-label {
    font-variant-numeric: tabular-nums;
}

.jalali-datefield-label.is-placeholder {
    color: rgba(142, 160, 184, 0.58);
}

.jalali-datefield-icon {
    color: var(--muted);
    flex-shrink: 0;
    height: 18px;
    width: 18px;
}

.jalali-calendar-backdrop {
    align-items: center;
    background: rgba(3, 5, 9, 0.72);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 16px;
    position: fixed;
    z-index: 200;
}

.jalali-calendar {
    background: linear-gradient(180deg, rgba(19, 26, 38, 0.98), rgba(13, 18, 27, 0.98));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: 18px;
    position: relative;
    width: min(320px, 92vw);
}

.jalali-calendar-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
}

.jalali-calendar-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 34px 14px;
}

.jalali-calendar-nav-group {
    display: flex;
    gap: 6px;
}

.jalali-calendar-nav-btn {
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.95rem;
    height: 32px;
    justify-content: center;
    width: 32px;
    transition: 140ms ease;
}

.jalali-calendar-nav-btn:hover {
    border-color: rgba(154, 215, 255, 0.62);
    color: var(--ice);
}

.jalali-calendar-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}

.jalali-calendar-weekdays {
    color: var(--muted);
    display: grid;
    font-size: 0.72rem;
    font-weight: 800;
    gap: 4px;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
    text-align: center;
}

.jalali-calendar-days {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(7, 1fr);
}

.jalali-calendar-day {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(5, 8, 13, 0.55);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    justify-content: center;
    transition: 140ms ease;
}

.jalali-calendar-day:hover {
    border-color: rgba(154, 215, 255, 0.62);
    transform: translateY(-1px);
}

.jalali-calendar-day.is-outside {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.jalali-calendar-day.is-today {
    border-color: var(--ice);
    box-shadow: 0 0 0 3px rgba(88, 198, 255, 0.13), 0 0 22px rgba(88, 198, 255, 0.13);
}

.jalali-calendar-day.is-selected {
    background: linear-gradient(135deg, var(--ice-strong), var(--green));
    border-color: transparent;
    color: #061017;
    font-weight: 900;
}

.jalali-calendar-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

@media (max-width: 380px) {
    .jalali-calendar {
        padding: 14px;
    }

    .jalali-calendar-day {
        font-size: 0.78rem;
    }
}

.alert {
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 18px;
    padding: 12px 14px;
}

.alert-error {
    background: var(--red-dim);
    border: 1px solid rgba(255, 107, 122, 0.28);
    color: #ffc9cf;
}

.dashboard-hero {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
}

.dashboard-hero h1 {
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    letter-spacing: -0.075em;
    line-height: 1;
    margin: 8px 0 14px;
}

.dashboard-hero .muted {
    max-width: 690px;
}

.tasks-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.task-card {
    overflow: hidden;
    padding: 20px;
    position: relative;
}

.task-card::before {
    background: linear-gradient(90deg, transparent, rgba(154, 215, 255, 0.32), transparent);
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.task-topline {
    align-items: start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.task-topline h2 {
    font-size: 1.12rem;
    letter-spacing: -0.035em;
    line-height: 1.4;
}

.task-topline p {
    color: var(--muted);
    font-size: 0.91rem;
    margin-top: 5px;
}

.task-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8rem;
    gap: 9px;
    margin-top: 18px;
}

.meta-dot {
    background: var(--line-strong);
    border-radius: 50%;
    height: 4px;
    width: 4px;
}

.progress-shell {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--line);
    border-radius: 999px;
    height: 12px;
    margin-top: 16px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--ice-strong), var(--green));
    height: 100%;
    min-width: 0;
    transition: width 200ms ease;
}

.progress-label {
    color: var(--muted);
    display: flex;
    font-size: 0.82rem;
    justify-content: space-between;
    margin-top: 9px;
}

.progress-label strong {
    color: var(--text);
}

.days-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.day-cell {
    align-items: center;
    background: rgba(5, 8, 13, 0.58);
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    position: relative;
    transition: 140ms ease;
    width: 36px;
}

.day-cell:hover {
    border-color: rgba(154, 215, 255, 0.62);
    color: var(--text);
    transform: translateY(-1px);
}

.day-cell.completed {
    background: var(--green-dim);
    border-color: rgba(69, 224, 139, 0.48);
    color: #d7ffe9;
}

.day-cell.completed::after {
    background: var(--green);
    border-radius: 50%;
    bottom: 5px;
    content: "";
    height: 4px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 4px;
}

.day-cell.today {
    border-color: var(--ice);
    box-shadow: 0 0 0 3px rgba(88, 198, 255, 0.13), 0 0 22px rgba(88, 198, 255, 0.13);
    color: var(--text);
}

.day-cell.missed {
    background: var(--red-dim);
    border-color: rgba(255, 107, 122, 0.28);
    color: #ffc3ca;
}

.empty-state {
    align-items: center;
    display: grid;
    justify-items: center;
    min-height: 360px;
    padding: 42px 24px;
    text-align: center;
}

.empty-orbit {
    border: 1px solid rgba(154, 215, 255, 0.28);
    border-radius: 50%;
    height: 92px;
    margin-bottom: 20px;
    position: relative;
    width: 92px;
}

.empty-orbit::before,
.empty-orbit::after {
    border-radius: 50%;
    content: "";
    position: absolute;
}

.empty-orbit::before {
    background: var(--green);
    height: 12px;
    left: 12px;
    top: 12px;
    width: 12px;
}

.empty-orbit::after {
    border: 1px solid rgba(69, 224, 139, 0.36);
    inset: 18px;
}

.empty-state h2 {
    font-size: 1.35rem;
    letter-spacing: -0.04em;
}

.empty-state p {
    color: var(--muted);
    margin: 8px 0 20px;
    max-width: 440px;
}

.modal {
    align-items: center;
    background: rgba(3, 5, 9, 0.72);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 50;
}

.modal.is-open {
    display: flex;
}

.modal-panel {
    max-width: 560px;
    padding: 24px;
    width: min(100%, 560px);
}

.modal-header {
    align-items: start;
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.modal-header h2 {
    font-size: 1.55rem;
    letter-spacing: -0.05em;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

@media (max-width: 820px) {
    .auth-screen {
        grid-template-columns: 1fr;
    }

    .auth-copy h1 {
        font-size: clamp(2.4rem, 15vw, 4.6rem);
    }

    .dashboard-hero {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .navbar,
    .container {
        width: min(100% - 22px, 1180px);
    }

    .tasks-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .task-card,
    .modal-panel {
        border-radius: 18px;
        padding: 18px;
    }

    .day-cell {
        height: 32px;
        width: 32px;
    }
}
