/* Onyar · app.onyar.es — mateixa identitat que onyar.es (vegeu marca/manual-de-marca.html) */
:root {
  --cream: #F6EFE6; --sand: #EFE6DA; --paper: #FFFFFF; --ink: #23201C; --ink-soft: #5A524A; --line: #E2D6C6;
  --terra: #B9472A; --terra-dark: #8F3620; --ochre: #E2A52E; --ochre-soft: #FBF3E3;
  --blue: #1E3A5C; --blue-2: #2E5378; --green: #5E7F5B; --green-light: #8FB08B; --tile: #D9774F;
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--f-display); margin: 0; line-height: 1.08; letter-spacing: -0.025em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--ink-soft); }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: -0.04em; line-height: 1; }
.logo-mark { width: 36px; height: 36px; flex-shrink: 0; }
.brand-light span { color: var(--cream); }

/* Botons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border-radius: 14px; border: 1.5px solid transparent; font: 600 16px var(--f-body); cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), background-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .7; cursor: progress; transform: none; }
.btn-primary { background: var(--terra); color: #fff; box-shadow: 0 6px 0 -2px var(--terra-dark); }
.btn-primary:hover { background: #A63E23; }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(35,32,28,.22); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }

/* Idioma */
.lang { display: inline-flex; background: rgba(35,32,28,.06); border-radius: 10px; padding: 3px; }
.lang a { text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-soft); padding: 7px 10px; border-radius: 8px; min-height: 32px; display: inline-flex; align-items: center; }
.lang a.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Avisos */
.notice { border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 500; }
.notice-error { background: #FBEAE4; color: var(--terra-dark); border: 1px solid #F1C9BB; }
.notice-ok { background: #E8F1E7; color: #3E5C3B; border: 1px solid #CFE0CD; }
.notice-info { background: var(--ochre-soft); color: #6B4A0E; border: 1px solid #F1DFB6; }

/* ---------------- LOGIN ---------------- */
.login { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.login-panel { position: relative; overflow: hidden; background: var(--blue); color: var(--cream); padding: 40px 48px; display: flex; flex-direction: column; }
.panel-copy { margin-top: auto; margin-bottom: 200px; position: relative; z-index: 2; }
.panel-title { font-family: var(--f-display); font-weight: 800; font-size: clamp(40px, 4.6vw, 68px); line-height: 1; letter-spacing: -0.035em; color: #fff; }
.panel-txt { margin-top: 18px; font-size: 18px; color: #D3DAE3; max-width: 420px; }
.facades { position: absolute; left: 0; right: 0; bottom: 22px; height: 180px; display: flex; align-items: flex-end; gap: 6px; }
.facades i { flex: 1; border-radius: 4px 4px 0 0; transform: translateY(105%); animation: rise 1s var(--ease) forwards; position: relative; }
.facades i::after { content: ""; position: absolute; inset: 16% 24% 0 24%; background: repeating-linear-gradient(to bottom, rgba(246,239,230,.45) 0 9px, transparent 9px 26px); -webkit-mask: linear-gradient(90deg, #000 0 38%, transparent 38% 62%, #000 62%); mask: linear-gradient(90deg, #000 0 38%, transparent 38% 62%, #000 62%); }
.facades i:nth-child(1) { height: 58%; background: var(--terra); animation-delay: .05s; }
.facades i:nth-child(2) { height: 82%; background: var(--ochre); animation-delay: .12s; }
.facades i:nth-child(3) { height: 50%; background: var(--cream); animation-delay: .19s; }
.facades i:nth-child(4) { height: 72%; background: var(--green); animation-delay: .26s; }
.facades i:nth-child(5) { height: 92%; background: var(--tile); animation-delay: .33s; }
.facades i:nth-child(6) { height: 64%; background: #F0C66B; animation-delay: .40s; }
.facades i:nth-child(7) { height: 78%; background: var(--terra); animation-delay: .47s; }
.facades i:nth-child(8) { height: 56%; background: var(--blue-2); animation-delay: .54s; }
.facades i:nth-child(9) { height: 86%; background: var(--ochre); animation-delay: .61s; }
.facades i:nth-child(10) { height: 68%; background: var(--green-light); animation-delay: .68s; }
@keyframes rise { to { transform: translateY(0); } }
.river { position: absolute; left: 0; bottom: 0; width: 200%; height: 34px; fill: #152B45; animation: flow 16s linear infinite; }
@keyframes flow { to { transform: translateX(-50%); } }

.login-main { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px) 28px; }
.login-top { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.brand-mobile { display: none; margin-right: auto; }
.login-card { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.login-card h1 { font-size: clamp(32px, 3.4vw, 44px); font-weight: 800; }
.login-card > .muted { margin-top: 10px; margin-bottom: 26px; }
.login-card .notice { margin-bottom: 18px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { width: 100%; min-height: 54px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #FFFCF8; font: 16px var(--f-body); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: #A59A8D; }
.field input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(185,71,42,.14); }
.pass { position: relative; }
.pass input { padding-right: 92px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; font: 600 14px var(--f-body); color: var(--ink-soft); cursor: pointer; }
.pass-toggle:hover { background: var(--sand); color: var(--ink); }
.form .btn { margin-top: 6px; }
.forgot { margin-top: 22px; font-size: 15px; }
.forgot summary { cursor: pointer; font-weight: 600; color: var(--terra-dark); list-style: none; display: inline-flex; min-height: 44px; align-items: center; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.forgot p { color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.secure { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.secure svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-panel { display: none; }
  .brand-mobile { display: inline-flex; }
  .login-main { background: var(--cream); }
  .login-card { margin-top: 32px; }
}

/* ---------------- APP ---------------- */
.topbar { background: rgba(246,239,230,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 12px clamp(16px, 4vw, 32px); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.company { font-weight: 600; font-size: 14px; padding: 6px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--terra); color: #fff; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 17px; }
.me-txt { display: flex; flex-direction: column; line-height: 1.2; }
.me-txt b { font-size: 14px; }
.me-txt small { font-size: 12px; color: var(--ink-soft); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.home { padding-top: 48px; padding-bottom: 64px; }
.home h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -0.035em; }
.lead { font-size: 18px; margin-top: 10px; }
.eyebrow { font-family: var(--f-body); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--terra-dark); margin: 44px 0 18px; }
.modules { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 16px; }
.module { position: relative; border-radius: 8px 8px 18px 18px; padding: 26px 20px 20px; min-height: 200px; display: flex; flex-direction: column; gap: 6px; }
.module::before { content: ""; position: absolute; left: 14px; right: 14px; top: -10px; height: 10px; border-radius: 6px 6px 0 0; background: inherit; filter: brightness(.82); }
.module svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: auto; }
.module-name { font-family: var(--f-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin-top: 18px; }
.module-txt { font-size: 14px; opacity: .92; }
.module .chip { position: absolute; top: 18px; right: 16px; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.22); }
.module-fitxar { background: var(--terra); color: #fff; }
.module-torns { background: var(--ochre); color: var(--ink); }
.module-torns .chip { background: rgba(35,32,28,.12); }
.module-vacances { background: var(--blue); color: #fff; }
.module-docs { background: var(--green); color: #fff; }
.module-equip { background: var(--ink); color: var(--cream); }

@media (max-width: 640px) {
  .me-txt { display: none; }
  .company { order: 3; }
  .home { padding-top: 32px; }
}
