/* CalendUP — plain CSS, no framework. Colors are tokens with light and dark themes. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #182033;
  --muted: #5b6478;
  --border: #dfe3ec;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-soft: #d9f2ef;
  --on-primary: #ffffff;
  --accent: #f97352;
  --accent-soft: #ffe7e0;
  --danger: #c2362b;
  --danger-soft: #fde4e1;
  --warning: #9a6200;
  --warning-soft: #fff1d1;
  --blocked: #6b5bd6;
  --blocked-soft: #ebe8fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131c;
    --surface: #161c28;
    --surface-2: #1d2534;
    --text: #e8ecf4;
    --muted: #9aa4b8;
    --border: #2a3345;
    --primary: #2bb3a5;
    --primary-strong: #47c9bb;
    --primary-soft: #133a37;
    --on-primary: #06201d;
    --accent: #ff8c6e;
    --accent-soft: #3d2620;
    --danger: #ff6b5e;
    --danger-soft: #3d1f1d;
    --warning: #f4b740;
    --warning-soft: #3a2e13;
    --blocked: #a99cff;
    --blocked-soft: #2a2550;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-size: .95rem;
}
.brand b { color: var(--primary); }
.company-name {
  font-size: 1.05rem; font-weight: 600; color: var(--muted);
  padding-left: 14px; margin-left: -2px; border-left: 1px solid var(--border); line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.btn { color: var(--on-primary); }
.nav a.btn:hover { background: var(--primary-strong); color: var(--on-primary); }
@media (max-width: 720px) {
  .topbar .container { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { margin-left: 0; width: 100%; }
  .company-name { max-width: calc(100% - 140px); }
}

/* Public pages: on phones the nav collapses into a hamburger menu. */
.menu-toggle { display: none; }
@media (max-width: 720px) {
  .collapsible .menu-toggle {
    display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px;
    background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
  }
  .menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after {
    display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, background .2s;
  }
  .menu-toggle .bars { position: relative; }
  .menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle .bars::before { top: -6px; }
  .menu-toggle .bars::after { top: 6px; }
  .collapsible.open .menu-toggle .bars { background: transparent; }
  .collapsible.open .menu-toggle .bars::before { transform: translateY(6px) rotate(45deg); }
  .collapsible.open .menu-toggle .bars::after { transform: translateY(-6px) rotate(-45deg); }
  /* The open menu drops over the page instead of pushing it down. */
  .collapsible .nav {
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 100%; left: 0; right: 0; padding: 8px 16px 14px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .collapsible.open .nav { display: flex; }
  .collapsible .nav a { padding: 10px 12px; }
  .collapsible .nav a.btn { margin-top: 6px; }
}

main.container { padding-top: 36px; padding-bottom: 64px; }
@media (max-width: 720px) { main.container { padding-top: 24px; } }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card + .card { margin-top: 18px; }
.card.narrow { max-width: 460px; margin: 24px auto; }
.card h2 { margin-bottom: 14px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }

/* ---------- forms ---------- */
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
input[readonly] { background: var(--surface-2); color: var(--muted); cursor: default; }
input[type="file"] { padding: 7px; background: var(--surface-2); }
.field { margin-bottom: 14px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
/* Start and end of an appointment: date and time side by side, even on phones. */
.grid-when { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 14px; }
.appt-length { margin: -6px 0 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border-radius: var(--radius-sm); padding: 9px 16px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--primary); color: var(--on-primary); transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.icon { display: inline-flex; align-items: center; justify-content: center; padding: 6px; line-height: 0; }
.btn.block { width: 100%; }
.btn.lg { padding: 13px 22px; font-size: 1.05rem; }

/* ---------- alerts & badges ---------- */
.alert { border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 14px; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert.success { background: var(--primary-soft); color: var(--primary-strong); }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert.info { background: var(--surface-2); color: var(--text); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.admin { background: var(--primary-soft); color: var(--primary-strong); }
.badge.disabled { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; letter-spacing: .08em;
  background: var(--surface-2); padding: 10px 14px; border-radius: var(--radius-sm); user-select: all; word-break: break-all;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
th.actions-col { text-align: right; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.changes { font-size: .82rem; color: var(--muted); margin: 0; padding-left: 16px; }

/* ---------- agenda ---------- */
/* The toolbar stays just below the top bar, so the day can be changed anywhere on the grid. */
.agenda-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: -10px 0 6px; padding: 10px 0;
  position: sticky; top: var(--topbar-height, 0px); z-index: 9; background: var(--bg);
}
.agenda-toolbar input[type="date"] { width: auto; }
/* On phones: ◀ Hoje ▶, the date and the block button (icon only) on one line,
   with the day's name in small type below. */
@media (max-width: 560px) {
  .agenda-toolbar { gap: 6px; }
  .agenda-toolbar input[type="date"] { flex: 1; min-width: 0; padding-inline: 8px; }
  .agenda-toolbar .btn { padding-inline: 10px; }
  .agenda-toolbar .agenda-title { order: 1; flex-basis: 100%; font-size: .9rem; color: var(--muted); }
  .agenda-toolbar .btn-label { display: none; }
}
@media (max-width: 360px) {
  .agenda-toolbar { gap: 4px; }
  .agenda-toolbar .btn { padding-inline: 8px; }
}
.agenda-title { font-size: 1.15rem; font-weight: 700; }
.slots {
  list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; background: var(--surface);
  display: grid; grid-template-columns: 76px 1fr; grid-auto-rows: minmax(54px, auto);
}
/* Each slot places its cells on the shared grid, so an appointment can span several rows. */
.slot { display: contents; }
.slot > * { border-top: 1px solid var(--border); }
.slot:first-child > * { border-top: 0; }
.slot .time { grid-column: 1; padding: 14px 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; border-right: 1px solid var(--border); }
.slot .content { grid-column: 2; padding: 6px; display: flex; align-items: stretch; }
.slot-btn {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left;
  font: inherit; color: inherit; background: transparent; border: 1px dashed transparent; border-radius: var(--radius-sm);
  padding: 6px 12px; cursor: pointer;
}
.slot-btn.empty { color: var(--muted); }
.slot-btn.empty:hover { border-color: var(--border); background: var(--surface-2); }
.slot-btn.empty .plus { opacity: 0; transition: opacity .15s; }
.slot-btn.empty:hover .plus { opacity: 1; }
.slot-btn.appt { background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.slot-btn.appt:hover { border-color: var(--primary); }
.slot-btn.appt { justify-content: flex-start; }
/* In a tall cell, the title stays in view while the page scrolls. */
.slot-btn.appt .appt-label { position: sticky; top: calc(var(--topbar-height, 0px) + var(--toolbar-height, 0px) + 8px); display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.slot-btn.appt .title { font-weight: 700; }
/* An appointment that started on an earlier day, or goes on to a later one. */
.slot-btn.appt.from-before { border-top-style: dashed; border-top-left-radius: 0; border-top-right-radius: 0; }
.slot-btn.appt.goes-on { border-bottom-style: dashed; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.slot-btn .meta { font-size: .82rem; color: var(--muted); }
.slot.blocked .content { background: repeating-linear-gradient(135deg, var(--blocked-soft), var(--blocked-soft) 8px, transparent 8px, transparent 16px); }
.block-tag { font-size: .78rem; font-weight: 700; color: var(--blocked); display: inline-flex; gap: 4px; align-items: center; }
.slot-btn.block-only { border: 1px solid color-mix(in srgb, var(--blocked) 35%, transparent); background: color-mix(in srgb, var(--blocked-soft) 70%, transparent); }
.slot .content.split { gap: 6px; }
.slot .content.split .slot-btn.block-only { flex: 0 0 auto; }
.slot .content .block-tags { display: flex; flex-direction: column; gap: 6px; }
/* Lanes of appointments canceled by their clients: grey, beside the main lane. */
.slot .lane-gap, .slot .canceled-lane { border-left: 1px dashed var(--border); }
.slot .canceled-lane { padding: 6px; display: flex; align-items: stretch; min-width: 0; }
.slot-btn.appt.canceled { background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted); min-width: 0; }
.slot-btn.appt.canceled .appt-label { min-width: 0; max-width: 100%; }
.slot-btn.appt.canceled .title { font-weight: 600; text-decoration: line-through; }
.slot-btn.appt.canceled .title, .slot-btn.appt.canceled .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The appointment on the reminder answer page. */
.appt-summary { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; margin: 4px 0 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }

/* Shown in a tab when the app is opened in another one. */
.tab-lock {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(4px);
}
.tab-lock .card { width: 100%; margin: 0; }

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(10, 14, 22, .55); }
dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
dialog .dialog-head h2 { margin: 0; }
dialog .dialog-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
dialog .dialog-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.attachments { list-style: none; padding: 0; margin: 0 0 10px; }
.attachments li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.attachments li a { flex: 1; word-break: break-all; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.confirm-box { background: var(--warning-soft); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; }
.confirm-box p { color: var(--warning); margin-bottom: 8px; font-weight: 600; }

/* ---------- landing ---------- */
.hero { padding: 56px 0 40px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero .badge { border-radius: 12px; padding: 4px 10px; line-height: 1.4; margin-bottom: 10px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 520px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.mock {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  padding: 18px; transform: rotate(1.2deg);
}
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; }
.mock-row { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: .9rem; }
.mock-row .t { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.mock-pill { border-radius: 8px; padding: 6px 10px; }
.mock-pill.a { background: var(--primary-soft); }
.mock-pill.b { background: var(--accent-soft); }
.mock-pill.c { background: repeating-linear-gradient(135deg, var(--blocked-soft), var(--blocked-soft) 6px, transparent 6px, transparent 12px); color: var(--blocked); font-weight: 700; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0 48px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); font-size: 1.2rem; margin-bottom: 12px; }
.feature p { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; margin-bottom: 48px; }
.step { padding: 18px 18px 18px 60px; position: relative; background: var(--surface-2); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; }
main section[id] { scroll-margin-top: 80px; } /* clears the sticky top bar */
.pricing-section { margin-bottom: 48px; }
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 18px; margin: 20px 0 14px; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.plan-card.featured { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.plan-card .badge { align-self: flex-start; }
.plan-card h3 { margin: 0; }
.plan-card .price { margin: 4px 0; }
.plan-card .price strong { font-size: 2rem; }
.plan-card .price span { color: var(--muted); margin-left: 2px; }
.plan-card ul { list-style: none; padding: 0; margin: 8px 0 18px; flex: 1; }
.plan-card li { padding: 6px 0 6px 26px; position: relative; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 800; }
.center { text-align: center; }
@media (max-width: 720px) { .pricing { grid-template-columns: 1fr; } }
.band { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))); color: #fff; border-radius: 20px; padding: 36px; text-align: center; margin-bottom: 40px; }
.band h2 { font-size: 1.6rem; }
.band .btn { background: #fff; color: var(--primary-strong); }
footer.site { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .88rem; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 28px; }
  .mock { transform: none; }
  .features, .steps { grid-template-columns: 1fr; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (hover: none) { .slot-btn.empty .plus { opacity: .7; } }
