/*
 * FlowBoard "clean desk for work" theme.
 * Shared across every page: a calm desk-surface background plus two small
 * desk accessories injected by desk.js - a quick sticky-notes pad (top-right)
 * and a mini calendar (bottom-left, on the front of the desk). The two entry
 * pages (login/register) also use the CTA "desk" layout classes below, which
 * move the info and ads copy to a side panel so the action card leads.
 * Palette follows styles.css / theme.css tokens and adapts to dark mode.
 */

/* ---- Clean desk background (all pages) ---------------------------------- */
.desk-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 380px at 50% 0%, rgba(255, 255, 255, .60), rgba(255, 255, 255, 0) 70%) top center / 100% 60% no-repeat,
    repeating-linear-gradient(90deg, rgba(120, 90, 55, .05) 0 3px, rgba(120, 90, 55, 0) 3px 10px) bottom center / 100% 40% no-repeat,
    linear-gradient(180deg, #f3f6f0 0%, #eaf0e9 46%, #ddcfb6 55%, #cdbb9c 62%, #c3ad8b 100%) fixed;
}

:root[data-theme="dark"] .desk-page {
  background:
    radial-gradient(900px 380px at 50% 0%, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 70%) top center / 100% 60% no-repeat,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .20) 0 3px, rgba(0, 0, 0, 0) 3px 10px) bottom center / 100% 40% no-repeat,
    linear-gradient(180deg, #101916 0%, #14201c 46%, #241d15 55%, #2b2118 62%, #31261a 100%) fixed;
}

/* ---- CTA "desk" entry layout (login + register) ------------------------- */
.desk-entry .desk-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 48px) 16px;
}

.desk-entry-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(20px, 3vw, 42px);
  align-items: center;
}

/* Info + ads panel (left) */
.desk-pitch {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: clamp(20px, 3vw, 36px);
  color: var(--ink);
}

.desk-pitch h1 {
  margin: 0;
  font-family: Fraunces, serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: .98;
}

.desk-pitch-lead {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.desk-tools {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.desk-tools li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--fb-radius-sm,12px);
  background: rgba(255, 255, 251, .72);
  box-shadow: 0 8px 24px rgba(35, 48, 47, .07);
}

:root[data-theme="dark"] .desk-tools li {
  background: rgba(16, 25, 22, .62);
}

.desk-tool-ico {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
}

.desk-tool-ico svg {
  width: 20px;
  height: 20px;
}

.desk-tools strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
}

.desk-tools span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

/* Small "ad" / social proof strip under the pitch */
.desk-ad {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--fb-radius-sm,12px);
  background: rgba(217, 239, 234, .55);
}

:root[data-theme="dark"] .desk-ad {
  background: rgba(53, 199, 184, .12);
}

.desk-ad-badge {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: var(--fb-radius-pill,999px);
  color: #fff;
  background: var(--accent-dark);
  font-weight: 900;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.desk-ad p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.5;
}

.desk-ad strong {
  color: var(--ink);
}

/* The action card (right) */
.desk-entry .desk-signup.task-panel {
  width: 100%;
  min-height: auto;
  margin: 0;
}

/* Stack on smaller screens: action card first (call to action leads). */
@media (max-width: 900px) {
  .desk-entry-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .desk-entry .desk-signup {
    order: -1;
  }
  .desk-tools {
    grid-template-columns: 1fr;
  }
}

/* ---- Floating desk accessories (all pages) ------------------------------ */
/* The three tools (running-task clock, Notes, Calendar) share one small card
   docked in the bottom-left corner. The nav Menu stays alone in the top bar. */
.desk-dock {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 900;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 251, 0.82);
  box-shadow: 0 16px 40px rgba(35, 48, 47, .14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: 'Tajawal', system-ui, sans-serif;
}

.desk-widget {
  position: relative;
  font-family: 'Tajawal', system-ui, sans-serif;
}

/* The clock is adopted from kanban-state.js; flatten its own fixed styling so
   it sits inline with the other tools inside the dock card. */
.desk-dock .task-watch-corner {
  position: static;
  inset: auto;
  max-width: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.desk-dock .desk-widget-btn {
  box-shadow: none;
}

:root[data-theme="dark"] .desk-dock {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(14, 23, 21, 0.86);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .desk-dock .task-watch-corner {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .desk-dock .desk-widget-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-dark) !important;
}

.desk-widget-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--fb-radius-pill,999px);
  color: var(--accent-dark);
  background: var(--surface, #fffffb);
  font-weight: 900;
  font-size: .86rem;
  box-shadow: 0 10px 28px rgba(35, 48, 47, .16);
}

.desk-widget-btn svg {
  width: 18px;
  height: 18px;
}

.desk-widget-panel {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 268px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #fffffb);
  box-shadow: 0 24px 60px rgba(35, 48, 47, .22);
}

.desk-widget[data-open="true"] .desk-widget-panel {
  display: block;
}

.desk-widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 900;
  font-size: .95rem;
}

.desk-widget-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 900;
}

/* Sticky notes pad */
.desk-note-pad {
  display: grid;
  gap: 8px;
}

.desk-note-input {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: #4a3c14;
  background: #fff6c9;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(74, 60, 20, .18);
}

.desk-note-input::placeholder {
  color: rgba(74, 60, 20, .55);
  font-weight: 600;
}

.desk-note-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(74, 60, 20, .4);
}

.desk-note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.desk-note-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff6c9;
  box-shadow: inset 0 0 0 1px rgba(74, 60, 20, .1);
}

.desk-note-text {
  flex: 1;
  border: 0;
  background: transparent;
  text-align: start;
  color: #4a3c14;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.desk-note-item.is-done .desk-note-text {
  text-decoration: line-through;
  opacity: .55;
}

.desk-note-del {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: rgba(74, 60, 20, .6);
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.desk-note-del:hover,
.desk-note-del:focus-visible {
  color: var(--danger, #c0392b);
}

.desk-note-empty {
  padding: 6px 2px;
  color: rgba(74, 60, 20, .55);
  font-size: .8rem;
  font-weight: 600;
}

:root[data-theme="dark"] .desk-note-input,
:root[data-theme="dark"] .desk-note-item {
  color: #f6ecc0;
  background: #3a3410;
  box-shadow: inset 0 0 0 1px rgba(246, 236, 192, .14);
}

:root[data-theme="dark"] .desk-note-input,
:root[data-theme="dark"] .desk-note-text {
  color: #f6ecc0;
}

:root[data-theme="dark"] .desk-note-input::placeholder,
:root[data-theme="dark"] .desk-note-empty,
:root[data-theme="dark"] .desk-note-del {
  color: rgba(246, 236, 192, .55);
}

.desk-note-foot {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

/* Mini calendar */
.desk-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.desk-cal-head strong {
  color: var(--ink);
  font-size: .92rem;
}

.desk-cal-nav {
  min-width: 28px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent-dark);
  font-weight: 900;
}

.desk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.desk-cal-grid span {
  text-align: center;
  font-size: .68rem;
  font-weight: 800;
  color: var(--muted);
  padding: 3px 0;
}

.desk-cal-grid b {
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  padding: 5px 0;
  border-radius: 7px;
}

.desk-cal-grid b.today {
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.desk-cal-grid b.blank {
  color: transparent;
}

@media (max-width: 560px) {
  .desk-dock { left: 12px; bottom: 12px; }
  .desk-widget-panel { width: min(76vw, 268px); }
}

@media (prefers-reduced-motion: no-preference) {
  .desk-widget-panel { animation: desk-pop .16s ease; }
}

@keyframes desk-pop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
