/* moodwall.app — shared UI styles */
:root {
  --ink: #1d1d1f;
  --ink-2: #4a4a50;
  --muted: #8a8a92;
  --line: #e7e5e1;
  --paper: #faf8f5;
  --card: #ffffff;
  --accent: #8b3dff;
  --accent-2: #7330e0;
  --accent-soft: #f1e9ff;
  --danger: #e5484d;
  --ok: #30a46c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 16, 30, .06), 0 8px 28px rgba(20, 16, 30, .10);
  --shadow-lg: 0 2px 4px rgba(20, 16, 30, .06), 0 22px 60px rgba(20, 16, 30, .18);
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--ui); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }

/* logo */
.logo { font-family: var(--display); font-size: 22px; font-weight: 400; color: var(--ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.logo em { font-style: italic; color: var(--accent); }
.logo span { font-family: var(--ui); font-size: .55em; color: var(--muted); margin-left: 2px; letter-spacing: .02em; }
.logo.big { font-size: 40px; }
.logo.small { font-size: 20px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(139, 61, 255, .3); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: #f3f1ee; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--ink-2); text-decoration: none; font-size: 16px; }
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg circle { fill: currentColor; stroke: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #8b3dff, #ff7a93); color: #fff; font-weight: 700; font-size: 13px; flex: none; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* dropdown */
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; z-index: 50; }
.dropdown button { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.dropdown button:hover { background: #f4f2ef; }
.dropdown button.danger { color: var(--danger); }
.dropdown kbd { font: 11px var(--ui); color: var(--muted); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(25, 20, 35, .42); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px 24px 24px; animation: pop .18s ease-out; }
.modal.small { width: min(440px, 100%); }
.modal.wide { width: min(1080px, 100%); }
.modal h2 { margin: 0 0 6px; font: 600 20px/1.3 var(--ui); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dlg-text { color: var(--ink-2); white-space: pre-line; margin: 6px 0 16px; line-height: 1.6; }
.dlg-input { width: 100%; margin: 8px 0 16px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* toasts */
.toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; align-items: center; }
.toast { background: #1d1d1f; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px); transition: .25s; font-weight: 500; max-width: 90vw; }
.toast.in { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

/* ================================================================ auth */
.auth-page { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; background: #f4efe8; }
.auth-art { position: relative; overflow: hidden; background:
  radial-gradient(circle at 20% 20%, rgba(255, 190, 152, .55), transparent 45%),
  radial-gradient(circle at 80% 70%, rgba(139, 61, 255, .22), transparent 50%), #efe7dc; }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 0, 0, .12) 1px, transparent 1.3px); background-size: 22px 22px; }
.art-card { position: absolute; border-radius: 6px; box-shadow: var(--shadow-lg); z-index: 1; }
.art-card.c1 { width: 34%; height: 44%; left: 9%; top: 12%; transform: rotate(-5deg); background: linear-gradient(160deg, #a47864, #5b3a29); border: 10px solid #fff; border-bottom-width: 44px; }
.art-card.c2 { width: 28%; height: 30%; left: 46%; top: 9%; transform: rotate(4deg); background: #bb2649; display: flex; align-items: center; justify-content: center; }
.art-card.c2 span { font: 400 clamp(60px, 9vw, 130px) 'Fraunces', serif; color: #ffbe98; font-style: italic; }
.art-card.c3 { width: 30%; height: 36%; left: 50%; top: 48%; transform: rotate(-3deg); background: linear-gradient(200deg, #92a8d1, #0f4c81); }
.art-chip { position: absolute; z-index: 2; width: 110px; background: #fff; padding: 7px 7px 10px; box-shadow: var(--shadow); font-size: 11px; line-height: 1.25; }
.art-chip i { display: block; height: 86px; margin-bottom: 7px; }
.art-chip b { display: block; } .art-chip small { color: #666; }
.art-chip.k1 { left: 13%; top: 62%; transform: rotate(6deg); } .art-chip.k1 i { background: #a47864; }
.art-chip.k2 { left: 30%; top: 66%; transform: rotate(-4deg); } .art-chip.k2 i { background: #ffbe98; }
.art-chip.k3 { left: 82%; top: 22%; transform: rotate(8deg); } .art-chip.k3 i { background: #bb2649; }
.art-sticky { position: absolute; z-index: 2; right: 7%; bottom: 9%; width: 190px; height: 170px; background: #fff3a3; padding: 18px; font: 28px/1.1 'Caveat', cursive; transform: rotate(3deg); box-shadow: var(--shadow); }
.art-scribble { position: absolute; z-index: 3; width: 42%; left: 6%; bottom: 6%; mix-blend-mode: multiply; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 90px); background: #fff; }
.auth-tag { color: var(--ink-2); font-size: 15px; margin: 10px 0 30px; max-width: 420px; }
.tabs { display: flex; background: #f3f1ee; border-radius: 11px; padding: 4px; margin-bottom: 22px; max-width: 420px; }
.tab { flex: 1; border: 0; background: none; padding: 9px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.auth-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.auth-form label small { font-weight: 400; color: var(--muted); }
.auth-form input { padding: 12px 13px; font-size: 15px; }
.form-msg { color: var(--danger); min-height: 20px; margin: 0; font-weight: 500; }
@media (max-width: 820px) { .auth-page { grid-template-columns: 1fr; } .auth-art { height: 34vh; } }

/* =========================================================== dashboard */
.dash-top { display: flex; justify-content: space-between; align-items: center; padding: 14px clamp(16px, 4vw, 48px); background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.dash-user { display: flex; align-items: center; gap: 10px; }
.dash-name { font-weight: 600; }
.dash-main { padding: 34px clamp(16px, 4vw, 48px) 80px; max-width: 1440px; margin: 0 auto; }
.dash-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.dash-hero h1 { font: 400 40px/1.1 var(--display); margin: 0 0 6px; letter-spacing: -.02em; }
.dash-hero p { margin: 0; color: var(--muted); }
.dash-main h2 { font: 600 18px var(--ui); margin: 44px 0 16px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.board-card { position: relative; background: #fff; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 0 0 1px var(--line); overflow: visible; transition: box-shadow .2s, transform .2s; }
.board-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link { display: block; }
.card-cover { position: relative; height: 170px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.card-cover img { position: absolute; right: 14px; top: 14px; width: 46%; height: 70%; object-fit: cover; box-shadow: var(--shadow); transform: rotate(3deg); border: 5px solid #fff; }
.cover-chips { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; }
.cover-chips i { width: 28px; height: 38px; border: 3px solid #fff; border-bottom-width: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.card-meta { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px 12px 14px; gap: 8px; }
.card-title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.card-sub { color: var(--muted); font-size: 12px; }
.card-dd { top: auto; bottom: 48px; right: 8px; }
.new-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 232px; border: 2px dashed #d8d3cc; background: transparent; box-shadow: none; cursor: pointer; color: var(--ink-2); }
.new-card span { font-size: 40px; line-height: 1; color: var(--accent); }
.new-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.empty-note { color: var(--muted); padding: 20px 4px; grid-column: 1 / -1; }
.field-inline { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 18px; }
.field-inline input { flex: 1; max-width: 420px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tpl-grid.busy { opacity: .5; pointer-events: none; }
.tpl-card { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.tpl-card b { margin-top: 6px; } .tpl-card small { color: var(--muted); font-size: 12px; }
.tpl-prev { position: relative; height: 128px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s; padding: 12px; }
.tpl-card:hover .tpl-prev { box-shadow: 0 0 0 2px var(--accent), var(--shadow); transform: translateY(-2px); }
.tpl-card.blank .tpl-prev { display: flex; align-items: center; justify-content: center; background: #fafaf8; font-size: 36px; color: var(--accent); }
.tpl-title { font-size: 21px; line-height: 1.05; max-width: 90%; }
.tpl-ph { position: absolute; left: 12px; right: 12px; top: 54px; display: flex; gap: 6px; }
.tpl-ph i { flex: 1; height: 38px; background: rgba(127, 127, 127, .18); border-radius: 3px; }
.tpl-pal { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 4px; }
.tpl-pal i { width: 20px; height: 20px; border-radius: 4px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
.notfound { max-width: 520px; margin: 14vh auto; text-align: center; padding: 20px; }
.notfound h1 { font: 400 36px var(--display); margin: 30px 0 8px; }
.notfound p { color: var(--muted); margin-bottom: 26px; }
