:root {
  --color-bg: #f2ede4;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #1a1a1a99;
  --color-accent: #d62e1f;
  --color-accent-dark: #b02518;
  --color-whatsapp: #25d366;
  --color-border: #1a1a1a14;
  --color-warm: #d8ccba;
  --radius: 12px;
  --font-sans: "Archivo", system-ui, sans-serif;
  --font-script: "Caveat", cursive;
  --shadow: 0 18px 40px -24px rgba(26, 26, 26, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--color-text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #fff8ef 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #e8dcc8 0%, transparent 45%),
    var(--color-bg);
  line-height: 1.5;
  font-weight: 500;
}

h1,
h2,
h3 {
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.4rem;
}

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

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-script);
  font-size: 1.35rem;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.auth-card--wide {
  width: min(560px, 100%);
}

.auth-copy {
  color: var(--color-muted);
  margin: 0 0 1.25rem;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

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

.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.auth-form .span-2 {
  grid-column: span 2;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #faf8f4;
}

.checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 0.6rem;
  grid-template-columns: none !important;
}

.checkbox input {
  margin-top: 0.25rem;
}

.auth-divider {
  display: grid;
  place-items: center;
  margin: 1rem 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.auth-divider::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: var(--color-border);
  grid-area: 1 / 1;
}

.auth-divider span {
  grid-area: 1 / 1;
  background: var(--color-surface);
  padding: 0 0.6rem;
}

.auth-forgot {
  margin: -0.35rem 0 0;
  text-align: right;
  font-size: 0.9rem;
}

.auth-forgot a {
  color: var(--color-muted);
  text-decoration: none;
}

.auth-forgot a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.auth-footer {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--color-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-block {
  width: 100%;
}

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

.btn-accent:hover {
  background: var(--color-accent-dark);
  color: #fff;
}

.btn-google {
  background: #1a1a1a;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: #073b1a;
}

.alert {
  background: #fdecea;
  border: 1px solid #f5c2bc;
  color: #8a1f14;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-text);
  object-fit: cover;
  flex-shrink: 0;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.auth-trial-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #fff1d6;
  color: #8a5a00;
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--color-text);
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-weight: 900;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.avatar-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-text);
  border-radius: 50%;
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.avatar-btn:hover {
  box-shadow: 0 0 0 3px rgba(214, 46, 31, 0.18);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar-img--lg,
.avatar-fallback--lg {
  width: 56px;
  height: 56px;
}

.avatar-img--xl,
.avatar-fallback--xl {
  width: 88px;
  height: 88px;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #efe6d8;
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 50%;
}

.avatar-fallback--lg {
  font-size: 1rem;
}

.avatar-fallback--xl {
  font-size: 1.35rem;
  border: 2px solid var(--color-text);
}

.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.35);
  z-index: 40;
}

.account-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -18px 0 40px -24px rgba(26, 26, 26, 0.4);
  z-index: 50;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  padding: 1.1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-drawer.is-open {
  transform: translateX(0);
}

body.drawer-open {
  overflow: hidden;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.drawer-identity h2 {
  font-size: 1.05rem;
  margin: 0;
}

.drawer-identity .muted {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0 0.25rem;
}

.drawer-nav {
  display: grid;
  gap: 0.45rem;
}

.drawer-link {
  display: grid;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #faf8f4;
}

.drawer-link:hover {
  border-color: #d6c6ae;
  background: #fff;
}

.drawer-link-title {
  font-weight: 800;
}

.drawer-link-desc {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.drawer-link--danger .drawer-link-title {
  color: var(--color-accent);
}

.topbar-user {
  color: var(--color-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
}

.topbar-user:hover {
  color: var(--color-text);
}

.link-muted {
  color: var(--color-muted);
  text-decoration: none;
}

.pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.pill-trial {
  background: #fff1d6;
  color: #8a5a00;
}

.pill-active {
  background: #e3f7ea;
  color: #146c36;
}

.pill-link {
  text-decoration: none;
}

.pill-link:hover {
  filter: brightness(0.97);
}

.app-main {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.banner-trial {
  background: #fff7e8;
  border: 1px solid #ead7a8;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.banner-trial--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.banner-active {
  background: #e3f7ea;
  border: 1px solid #b7e4c7;
  color: #146c36;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.account-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.account-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.account-card .auth-form input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.alert-ok {
  background: #e3f7ea;
  border-color: #b7e4c7;
  color: #146c36;
}

.board {
  display: grid;
  gap: 1.75rem;
}

.board-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-head h2 {
  margin-bottom: 0;
}

.inline-create {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.inline-create.is-hidden {
  display: none;
}

.inline-create input {
  flex: 1 1 220px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  background: var(--color-surface);
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.9rem;
}

.form-error {
  color: var(--color-accent);
  margin: -0.35rem 0 0.75rem;
  font-size: 0.9rem;
}

.tile-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px -22px rgba(26, 26, 26, 0.45);
}

.tile-folder {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tile-body {
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.tile-actions {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--color-border);
}

.btn-icon-danger {
  border: none;
  background: transparent;
  color: var(--color-accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.btn-icon-danger:hover {
  text-decoration: underline;
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid #f5c2bc;
  color: var(--color-accent);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

.tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 110px;
  box-shadow: var(--shadow);
}

.tile-folder {
  background: linear-gradient(160deg, #fff 0%, #f6efe4 100%);
}

.empty {
  color: var(--color-muted);
  margin: 0;
}

.gate {
  max-width: 520px;
  margin: 4rem auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.stub-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.stub-panel ol {
  margin: 0;
  padding-left: 1.2rem;
}

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

  .auth-form .span-2 {
    grid-column: span 1;
  }

  .page-head {
    flex-direction: column;
  }

  .topbar-desk {
    display: none;
  }
}
