/* Home Reminders — hand-written dark theme. No Tailwind, no build step. */

:root {
    --bg: #0a0a0a;
    --bg-elevated: #161616;
    --bg-card: #1c1c1e;
    --border: #2a2a2c;
    --text: #f5f5f5;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-dark: #1d4ed8;
    --red: #ef4444;
    --amber: #f59e0b;
    --green: #22c55e;
    --danger: #ef4444;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 96px;
}

/* ---------- Header ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}

.app-header .brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.app-header .brand a {
    color: inherit;
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 1.1rem;
}

/* ---------- Flash / errors ---------- */

.flash {
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: var(--green);
    font-size: 0.9rem;
}

.errors {
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--red);
    font-size: 0.85rem;
}

.errors ul {
    margin: 0;
    padding-left: 18px;
}

/* ---------- Item list ---------- */

.item-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
}

.item-card.status-red {
    border-left-color: var(--red);
}

.item-card.status-amber {
    border-left-color: var(--amber);
}

.item-card.status-green {
    border-left-color: var(--green);
}

.item-card-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.thumb,
.thumb-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--bg-elevated);
}

.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    display: block;
    font-weight: 600;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.due-line {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
}

.due-line.status-red {
    color: var(--red);
}

.due-line.status-amber {
    color: var(--amber);
}

.due-line.status-green {
    color: var(--green);
}

.interval-note {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* ---------- Done section ---------- */

.done-section {
    margin-top: 24px;
}

.done-section summary {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 0;
}

.done-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    color: var(--text-muted);
    text-decoration: none;
}

/* ---------- Forms ---------- */

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="file"],
textarea {
    width: 100%;
    padding: 11px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.preview-photo {
    max-width: 160px;
    border-radius: var(--radius);
    margin-top: 10px;
    display: block;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

/* ---------- Detail page ---------- */

.detail-photo {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 16px 0;
    background: var(--bg-elevated);
}

.detail-photo-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    margin: 16px 0;
}

.detail-status {
    font-weight: 700;
    font-size: 1.1rem;
}

.detail-status.status-red {
    color: var(--red);
}

.detail-status.status-amber {
    color: var(--amber);
}

.detail-status.status-green {
    color: var(--green);
}

.field-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.field-row dt {
    color: var(--text-muted);
}

.field-row dd {
    margin: 0;
    text-align: right;
}

.history-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 24px 0 4px;
}

.login-card {
    max-width: 360px;
    margin: 20vh auto 0;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.login-card h1 {
    font-size: 1.2rem;
    margin-top: 0;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
}
