/*
 * Urbecta Design Tokens
 *
 * CSS custom properties for runtime theme switching via [data-theme="dark"]
 * or [data-theme="light"] on the <html> element. When no attribute is set,
 * prefers-color-scheme is respected.
 *
 * Reference: urbecta-brand-guide.md §2, §5, §6
 */

:root {
  /* Accent — cyan */
  --accent: #0891b2;
  --accent-light: #22d3ee;
  --accent-dark: #0e7490;
  --accent-glow: rgba(8, 145, 178, 0.15);

  /* Text color on the primary gradient button. Swapped in dark mode below
   * because the dark-mode gradient is LIGHT cyan — white text disappears. */
  --btn-p-text: #ffffff;

  /* Emerald */
  --emerald: #059669;
  --emerald-light: #10b981;

  /* Violet */
  --violet: #7c3aed;
  --violet-light: #8b5cf6;

  /* Amber */
  --amber: #d97706;
  --amber-light: #f59e0b;

  /* Danger */
  --danger: #e11d48;
  --danger-light: #f43f5e;

  /* Surfaces */
  --bg: #ffffff;
  --bg2: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;

  /* Text */
  --text: #1e293b;
  --text-muted: #64748b;
  --text-heading: #0f172a;

  /* Borders */
  --border: #e2e8f0;
  --border-accent: rgba(8, 145, 178, 0.2);

  /* Geometry */
  --radius: 18px;

  /* Shadows */
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --accent: #22d3ee;
  --accent-light: #67e8f9;
  --accent-dark: #06b6d4;
  --accent-glow: rgba(34, 211, 238, 0.25);
  --btn-p-text: #0c1322;

  --emerald: #10b981;
  --emerald-light: #6ee7b7;

  --violet: #8b5cf6;
  --violet-light: #a78bfa;

  --amber: #f59e0b;
  --amber-light: #fbbf24;

  --danger: #f43f5e;
  --danger-light: #fb7185;

  --bg: #04080e;
  --bg2: #080d18;
  --bg-card: #0c1322;
  --bg-alt: #080d18;

  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-heading: #f8fafc;

  --border: #1a2744;
  --border-accent: rgba(34, 211, 238, 0.15);

  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* OS-level preference when no explicit data-theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #22d3ee;
    --accent-light: #67e8f9;
    --accent-dark: #06b6d4;
    --accent-glow: rgba(34, 211, 238, 0.25);
    --btn-p-text: #0c1322;

    --emerald: #10b981;
    --emerald-light: #6ee7b7;

    --violet: #8b5cf6;
    --violet-light: #a78bfa;

    --amber: #f59e0b;
    --amber-light: #fbbf24;

    --danger: #f43f5e;
    --danger-light: #fb7185;

    --bg: #04080e;
    --bg2: #080d18;
    --bg-card: #0c1322;
    --bg-alt: #080d18;

    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-heading: #f8fafc;

    --border: #1a2744;
    --border-accent: rgba(34, 211, 238, 0.15);

    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
  }
}

/* ================================================================
 * Buttons — §5.1
 * ================================================================ */
.btn-p {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  /* High-contrast fixed palette: white text on a dark cyan gradient. The
   * gradient stays dark in both themes so white always has ≥4.5:1 contrast
   * — the previous theme-swap design relied on dark text against light cyan
   * in dark mode, which dropped below 3:1 when the `prefers-color-scheme`
   * path bypassed the `[data-theme="dark"]` text-color override. */
  color: #ffffff;
  background: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 25px var(--accent-glow);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-p:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 45px var(--accent-glow);
}

.btn-p.btn-lg,
.btn-p--lg {
  padding: 0.85rem 2.4rem;
  font-size: 1rem;
}

.btn-o {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  background: transparent;
  border: 1.5px solid var(--border-accent);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-o:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-o.btn-lg,
.btn-o--lg {
  padding: 0.85rem 2.4rem;
  font-size: 1rem;
}

/* ================================================================
 * Section Label — §5.4
 * ================================================================ */
.sl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* ================================================================
 * Scroll Reveal — §6.2
 * ================================================================ */
.rv {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.rv.vis {
  opacity: 1;
  transform: translateY(0);
}
.rd1 { transition-delay: 100ms; }
.rd2 { transition-delay: 200ms; }
.rd3 { transition-delay: 300ms; }
.rd4 { transition-delay: 400ms; }

/* ================================================================
 * Gradient Text — §6.3
 * ================================================================ */
.gradient-text {
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--emerald-light), var(--accent-light));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 5s ease-in-out infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ================================================================
 * Ambient animations — §6.1, §6.5
 * ================================================================ */
@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 30px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes floatParticle {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-120vh) rotate(360deg); opacity: 0; }
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.6; }
}

@keyframes radialPulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.1); }
}

/* ================================================================
 * Ambient background layers — §6.1
 * ================================================================ */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.03;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
          mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  pointer-events: none;
}

[data-theme="dark"] .bg-grid {
  opacity: 0.018;
}

.orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.orbs > span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.05;
  animation: orbDrift 22s ease-in-out infinite;
}
.orbs > span:nth-child(1) {
  width: 420px; height: 420px;
  background: var(--accent);
  top: 10%; left: 10%;
}
.orbs > span:nth-child(2) {
  width: 360px; height: 360px;
  background: var(--emerald);
  top: 55%; right: 10%;
  animation-duration: 24s;
  animation-delay: -6s;
}
.orbs > span:nth-child(3) {
  width: 320px; height: 320px;
  background: var(--violet);
  bottom: 15%; left: 40%;
  animation-duration: 23s;
  animation-delay: -12s;
}

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.04;
}
[data-theme="dark"] .particles {
  opacity: 0.022;
}
.particles > span {
  position: absolute;
  color: var(--accent);
  font-size: 1rem;
  animation: floatParticle 28s linear infinite;
}

/* ================================================================
 * Marketing pages — shared scaffolding (landing + about + future)
 * ================================================================ */
.urbecta-landing {
  color: var(--text);
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
}
.urbecta-landing a { color: var(--accent); text-decoration: none; transition: color .25s; }
.urbecta-landing a:hover { color: var(--accent-dark); }
.urbecta-landing .cl { position: relative; z-index: 1; }
.urbecta-landing .container { max-width: 1200px; margin: 0 auto; }
.urbecta-landing section { padding: 6rem 2rem; position: relative; }
.urbecta-landing .u-st { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; color: var(--text-heading); margin-bottom: 1rem; line-height: 1.12; letter-spacing: -.02em; }
.urbecta-landing .u-sd { font-size: 1.05rem; color: var(--text-muted); max-width: 580px; line-height: 1.78; }

/* Sticky nav */
.u-nav { position: sticky; top: 0; z-index: 100; padding: .85rem 2rem; backdrop-filter: blur(28px) saturate(1.5); -webkit-backdrop-filter: blur(28px) saturate(1.5); background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.u-nav .nl { display: flex; gap: 1.8rem; align-items: center; }
.u-nav .nl a.u-nav-link { color: var(--text-muted); font-size: .87rem; font-weight: 500; position: relative; }
.u-nav .nl a.u-nav-link::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--emerald)); border-radius: 2px; transition: width .3s; }
.u-nav .nl a.u-nav-link:hover::after { width: 100%; }
.u-nav .nl a.u-nav-link:hover { color: var(--text-heading); }
.u-theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.u-theme-btn:hover { color: var(--accent); border-color: var(--border-accent); background: var(--accent-glow); }
@media (max-width: 768px) { .u-nav .nl > a.u-nav-link { display: none; } }

/* Origin (etymology) section */
.u-origin { text-align: center; background: var(--bg2); overflow: hidden; }
.u-ow { font-size: clamp(2.5rem, 6vw, 4.8rem); font-weight: 900; letter-spacing: -.03em; margin-bottom: .4rem; position: relative; z-index: 1; }
.u-ow .u { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.u-ow .r { background: linear-gradient(135deg, var(--emerald), var(--emerald-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.u-origin .osub { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.2rem; }
.u-origin .osub em { font-style: italic; color: var(--accent); }
.u-origin .odesc { font-size: .92rem; color: var(--text-muted); max-width: 540px; margin: 0 auto; line-height: 1.78; }
.u-opills { display: flex; justify-content: center; gap: .65rem; margin-top: 2rem; flex-wrap: wrap; }
.u-pill { padding: .4rem 1rem; border-radius: 50px; font-size: .78rem; font-weight: 600; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); box-shadow: var(--card-shadow); transition: all .4s; }
.u-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* Legal / long-form content pages (privacy, terms) */
.u-legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
  color: var(--text);
  line-height: 1.75;
  font-size: 1rem;
}
.u-legal h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.u-legal .u-legal-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 2.5rem;
}
.u-legal h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 2.25rem 0 0.75rem;
}
.u-legal p {
  margin: 0 0 1rem;
}
.u-legal ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.u-legal ul li {
  margin-bottom: 0.4rem;
}
.u-legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.u-legal-note {
  margin-top: 3rem;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Sales inquiry (contact-sales) form */
.u-sales-wrap { min-height: 70vh; padding: 4rem 2rem; background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%); }
.u-sales-card { max-width: 640px; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--card-shadow); }
.u-sales-card h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; color: var(--text-heading); letter-spacing: -.02em; margin: 0 0 .5rem; }
.u-sales-card .sub { color: var(--text-muted); font-size: 1rem; line-height: 1.6; margin: 0 0 2rem; }
.u-sales-alert { padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: .88rem; }
.u-sales-alert.success { background: color-mix(in srgb, var(--emerald) 12%, transparent); border: 1px solid color-mix(in srgb, var(--emerald) 35%, transparent); color: var(--emerald); }
.u-sales-alert.error { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.u-sales-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .u-sales-form .row { grid-template-columns: 1fr; } }
.u-sales-form label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-heading); margin: 1rem 0 .35rem; }
.u-sales-form label .req { color: var(--danger); }
.u-sales-form input[type="text"], .u-sales-form input[type="email"], .u-sales-form input[type="tel"], .u-sales-form select, .u-sales-form textarea {
  width: 100%; box-sizing: border-box; padding: .65rem .85rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.u-sales-form input:focus, .u-sales-form select:focus, .u-sales-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.u-sales-form textarea { resize: vertical; min-height: 110px; }
.u-sales-form .submit { margin-top: 1.75rem; }
.u-sales-form .submit button { width: 100%; }
.u-sales-privacy { font-size: .78rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }
.u-sales-honeypot { position: absolute !important; left: -10000px !important; top: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }

/* Footer */
.u-foot { padding: 3rem 2rem; border-top: 1px solid var(--border); background: var(--bg2); }
.u-foot-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
@media (max-width: 768px) { .u-foot-grid { grid-template-columns: 1fr; text-align: center; } }
.u-foot h4 { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-heading); margin-bottom: 1rem; }
.u-foot-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.u-foot-links a { color: var(--text-muted); font-size: .85rem; }
.u-foot-links a:hover { color: var(--accent); }
.u-foot-tag { color: var(--text-muted); font-size: .85rem; margin-top: .75rem; max-width: 320px; line-height: 1.65; }
.u-foot-copy { text-align: center; color: var(--text-muted); font-size: .82rem; padding-top: 2rem; border-top: 1px solid var(--border); margin-top: 2rem; }

/* ================================================================
 * Theme-toggle icon visibility (moon/sun)
 *
 * Scoped to [data-controller~="theme"] so any element hosting the
 * Stimulus theme controller picks up the rules — marketing nav
 * button (.u-theme-btn) and dashboard top-nav button alike.
 * The attribute selector's (0,1,1) specificity also out-specifics
 * FontAwesome's late-loading `.fa-solid { display: var(--fa-display,
 * inline-block) }` rule at (0,1,0), so the visibility toggle wins.
 * ================================================================ */
[data-controller~="theme"] .icon-sun  { display: none; }
[data-controller~="theme"] .icon-moon { display: inline-block; }
[data-theme="dark"] [data-controller~="theme"] .icon-sun  { display: inline-block; }
[data-theme="dark"] [data-controller~="theme"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-controller~="theme"] .icon-sun  { display: inline-block; }
  :root:not([data-theme="light"]) [data-controller~="theme"] .icon-moon { display: none; }
}

/* ================================================================
 * Themed scrollbars
 *
 * Used for nested-scroll containers (the booking calendar's apartment
 * grid in particular) where the default OS scrollbar feels jarring
 * against the rest of the UI. Thumb picks up the accent on hover; the
 * `border + background-clip: padding-box` trick gives the thumb a
 * 2 px transparent inset so it floats inside the lane (Mac-like).
 * ================================================================ */
:root {
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(100, 116, 139, 0.4);        /* slate-500 @ 40% */
  --scrollbar-thumb-hover: rgba(8, 145, 178, 0.7);    /* accent (cyan-600) @ 70% */
}
[data-theme="dark"] {
  --scrollbar-thumb: rgba(148, 163, 184, 0.3);        /* slate-400 @ 30% */
  --scrollbar-thumb-hover: rgba(34, 211, 238, 0.65);  /* accent (cyan-400) @ 65% */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --scrollbar-thumb: rgba(148, 163, 184, 0.3);
    --scrollbar-thumb-hover: rgba(34, 211, 238, 0.65);
  }
}

.scrollbar-themed {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.scrollbar-themed::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.scrollbar-themed::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.scrollbar-themed::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 120ms ease;
}
.scrollbar-themed::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}
.scrollbar-themed::-webkit-scrollbar-corner {
  background: transparent;
}

/* ================================================================
 * Reduced motion — §9
 * ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .orbs > span,
  .particles > span,
  .gradient-text {
    animation: none !important;
  }
  .rv { opacity: 1; transform: none; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
