/* Estilos específicos de la pantalla de inicio de sesión. */
html[data-page="login"] .syco-login {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  background: #080808;
  color: #141414;
  font-family: Arial, Helvetica, sans-serif;
}

/* La vista ocupa el viewport; el contenido puede crecer en pantallas bajas. */
.syco-login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: #f8f8fa;
  box-shadow: none;
}

/* Composición independiente: fotografía, logos originales y franjas CSS. */
.syco-artwork {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  background: #080808;
}

.syco-car-photo { position: absolute; inset: 0 0 auto; width: 100%; height: 63%; object-fit: cover; object-position: 25% center; mask-image: linear-gradient(to bottom, #000 45%, transparent 100%); }
.syco-artwork::before, .syco-artwork::after { content: ""; position: absolute; left: 0; bottom: 0; z-index: 1; pointer-events: none; }
.syco-artwork::before { width: 66%; height: 34%; clip-path: polygon(0 0, 100% 100%, 0 100%); background: linear-gradient(40deg, #151515 0 38%, #101010 38.5% 63%, transparent 63.5%); }
.syco-artwork::after { width: 34%; height: 21%; clip-path: polygon(0 0, 100% 100%, 0 100%); background: #ff7900; }
.syco-brand-logo { position: absolute; top: 42%; left: 50%; z-index: 2; display: flex; flex-direction: column; align-items: center; width: min(62%, 620px, 60svh); container-type: inline-size; transform: translateX(-50%); }
.syco-brand-symbol { width: 70%; height: auto; }
.syco-brand-name { width: 100%; height: auto; margin-top: -6%; margin-bottom: -8%; }
.syco-brand-tagline { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 1.8cqw, 14px); width: 100%; margin: 0; color: #eee; font-size: clamp(7px, 2.8cqw, 16px); line-height: 1.5; letter-spacing: clamp(.8px, .65cqw, 3.2px); text-transform: uppercase; white-space: nowrap; }
.syco-brand-tagline span { color: #ff7900; }

.syco-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  position: relative;
  isolation: isolate;
  padding: clamp(32px, 6svh, 96px) clamp(24px, 5vw, 112px);
}

.syco-form-content { width: 100%; max-width: clamp(380px, 30vw, 560px); min-width: 0; }

.syco-panel::before,
.syco-panel::after {
  content: "";
  position: absolute;
  right: 0;
  z-index: -1;
  width: clamp(80px, 12vw, 240px);
  height: clamp(72px, 11vw, 220px);
  pointer-events: none;
}

.syco-panel::before {
  top: 0;
  clip-path: polygon(30% 0, 100% 0, 100% 70%);
  background: linear-gradient(135deg, #ffbb69, #ff7900);
}

.syco-panel::after {
  bottom: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: linear-gradient(135deg, #ffbb69, #ff7900);
}

.syco-header { margin-bottom: clamp(24px, 3.6svh, 44px); }
.syco-title { margin: 0; color: inherit; font-size: clamp(28px, 2.6vw, 48px); font-weight: 700; line-height: 1.2; letter-spacing: -1px; }
.syco-description { margin: 7px 0 0; color: #252525; font-size: clamp(16px, 1.3vw, 22px); line-height: 1.4; }
html[data-page="login"] .syco-field { margin: 0 0 clamp(16px, 2.4svh, 28px); }
html[data-page="login"] .syco-field-password { margin-bottom: 8px; }
.syco-input-wrap { position: relative; display: flex; align-items: center; }

.syco-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: clamp(52px, 5.6svh, 68px);
  padding: 0 18px 0 58px;
  border: 1px solid #dedee2;
  border-radius: 8px;
  background: transparent;
  color: #252525;
  font-size: clamp(16px, 1.05vw, 18px);
  outline: none;
  box-shadow: 0 1px 4px #00000005;
  transition: border-color 150ms, box-shadow 150ms;
}

.syco-input::placeholder { color: #555; opacity: 1; }
.syco-input-password { padding-right: 54px; }
.syco-input:hover { border-color: #aaa; }
.syco-input:focus { border-color: #f57900; box-shadow: 0 0 0 3px #ff790026; }
.syco-field-icon { position: absolute; left: 18px; width: 22px; height: 22px; color: #404040; pointer-events: none; }
.syco-person-icon { display: none; }
.syco-toggle { display: grid; place-items: center; position: absolute; right: 5px; width: 44px; height: 44px; border-radius: 6px; color: #444; }
.syco-toggle svg { width: 22px; height: 22px; }
.syco-toggle:hover { background: #ff790014; }
.syco-field.has-error .syco-input { border-color: #c62828; }
html[data-page="login"] .syco-field .field-error { color: #b71c1c; line-height: 1.4; }

.syco-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 16px; font-size: clamp(13px, .9vw, 16px); }
.syco-remember { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; }
.syco-checkbox { appearance: none; display: grid; place-content: center; width: 18px; height: 18px; flex-shrink: 0; border: 1px solid #c1c1c6; border-radius: 3px; background: transparent; cursor: pointer; }
.syco-checkbox::before { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); }
.syco-checkbox:checked { border-color: #e56800; background: #e56800; }
.syco-checkbox:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
html[data-page="login"] .syco-forgot { display: inline-flex; align-items: center; min-height: 44px; color: #252525; text-decoration: underline; text-underline-offset: 2px; }

.syco-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: clamp(52px, 5.6svh, 68px);
  padding: 12px 20px;
  border-radius: 9px;
  background: #ff7900;
  color: #fff;
  font-size: clamp(16px, 1.1vw, 20px);
  font-weight: 600;
  transition: background 150ms, box-shadow 150ms;
}

.syco-submit:hover { background: #e96d00; box-shadow: 0 4px 16px #ff790033; }
.syco-submit:disabled { opacity: .7; cursor: wait; }
.syco-submit .btn-arrow { display: none; width: 20px; height: 20px; }
.syco-submit .spinner { display: none; width: 22px; height: 22px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: login-spin .7s linear infinite; }
.syco-submit.loading .spinner { display: block; }
.syco-submit.loading :is(.btn-text, .btn-arrow) { display: none; }
.syco-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0 8px; color: #555; font-size: 14px; line-height: 1.4; }
.syco-divider::before, .syco-divider::after { content: ""; flex: 1; height: 1px; background: #d4d4d8; }
html[data-page="login"] .syco-demo { display: flex; align-items: center; justify-content: center; align-self: center; gap: 12px; min-height: 44px; padding: 6px 12px; color: #171717; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }
.syco-demo svg { display: none; width: 23px; height: 23px; flex-shrink: 0; }
.syco-login :is(button, a, input[type="checkbox"]):focus-visible { outline: 2px solid #dc6500; outline-offset: 4px; }

@media (min-width: 768px) and (max-height: 600px) and (orientation: landscape) {
  .syco-panel { padding-block: 16px; }
  .syco-header { margin-bottom: 16px; }
  .syco-title { font-size: clamp(26px, 2.6vw, 36px); }
  .syco-description { font-size: 16px; }
  .syco-input { height: 48px; }
  html[data-page="login"] .syco-field { margin-bottom: 14px; }
  html[data-page="login"] .syco-field-password { margin-bottom: 4px; }
  .syco-options { margin-bottom: 8px; }
  .syco-submit { min-height: 48px; }
  .syco-divider { margin: 12px 0 0; }
}

@media (max-width: 767.98px), (max-width: 991.98px) and (orientation: portrait) {
  html[data-page="login"] .syco-login { display: block; padding: 0; color: #f7f7f7; }
  .syco-login-card { display: flex; flex-direction: column; background: linear-gradient(145deg, #080808 65%, #0e0e0e); }
  .syco-login-card::after { content: ""; position: absolute; right: 0; bottom: 0; z-index: -1; width: 58%; height: 20%; clip-path: polygon(100% 0, 100% 100%, 0 100%); background: linear-gradient(137deg, transparent 0 49%, #161616 49.5% 59%, #ff7900 59.5% 62%, #101010 62.5% 72%, #1c1c1c 72.5% 83%, #090909 83.5%); pointer-events: none; }
  .syco-artwork { flex-shrink: 0; width: 100%; height: clamp(260px, 44svh, 560px); }
  .syco-car-photo { height: 100%; object-position: left center; transform: scaleX(-1); mask-image: linear-gradient(to bottom, #000 35%, transparent 95%); }
  .syco-artwork::before { inset: 0 auto auto 0; width: 44%; height: 42%; clip-path: polygon(0 0, 100% 0, 0 100%); background: linear-gradient(135deg, #ff7900 0 10%, #111 10.5% 24%, #252525 24.5% 37%, #ff7900 37.5% 40%, #111 40.5% 56%, transparent 56.5%); }
  .syco-artwork::after { display: none; }
  .syco-brand-logo { top: auto; bottom: clamp(16px, 2.4svh, 28px); width: min(64%, 40svh, 400px); }
  .syco-brand-symbol { width: 59%; }
  .syco-panel { flex: 1; padding: min(4.1vw, 25px) clamp(22px, 7vw, 72px) max(40px, min(8vw, 64px), env(safe-area-inset-bottom, 0px)); }
  .syco-form-content { max-width: 520px; }
  .syco-panel::before, .syco-panel::after { display: none; }
  .syco-header { margin-bottom: min(5.4vw, 32px); text-align: center; }
  .syco-title { font-size: clamp(24px, 6.25vw, 38px); letter-spacing: -.6px; }
  .syco-title span { color: #ff7900; }
  .syco-description { margin-top: min(.6vw, 4px); color: #bfbfbf; font-size: clamp(16px, 4.34vw, 22px); }
  html[data-page="login"] .syco-field { margin-bottom: min(3.5vw, 21px); }
  html[data-page="login"] .syco-field-password { margin-bottom: 4px; }
  .syco-input { height: clamp(48px, 12.3vw, 64px); padding-left: 18.5%; border-color: #4b4b4b; border-radius: clamp(16px, 4.3vw, 26px); background: linear-gradient(110deg, #202020, #1c1c1c); color: #fff; font-size: clamp(16px, 4.1vw, 20px); box-shadow: inset 0 1px 2px #ffffff08; color-scheme: dark; }
  .syco-input::placeholder { color: #b8b8b8; }
  .syco-input-password { padding-right: 17%; }
  .syco-field-icon { left: 6%; width: 6%; height: auto; color: #f2f2f2; }
  .syco-email-icon { display: none; }
  .syco-person-icon { display: block; }
  .syco-toggle { right: 3%; color: #b8b8b8; }
  .syco-toggle svg { width: clamp(22px, 5vw, 30px); height: auto; }
  .syco-options { margin-bottom: min(3.7vw, 22px); font-size: clamp(12px, 3.2vw, 16px); }
  .syco-remember { gap: min(3vw, 18px); }
  .syco-checkbox { width: clamp(18px, 4.6vw, 28px); height: clamp(18px, 4.6vw, 28px); border: 1.5px solid #aaa; border-radius: 4px; color-scheme: dark; }
  html[data-page="login"] .syco-forgot { color: #ff9334; text-decoration: none; }
  .syco-submit { min-height: clamp(48px, 10.8vw, 65px); border-radius: clamp(16px, 4.3vw, 26px); font-size: clamp(16px, 4.1vw, 20px); }
  .syco-submit .btn-arrow { display: block; }
  .syco-submit.loading .btn-arrow { display: none; }
  .syco-divider { gap: min(3vw, 18px); margin: min(5.4vw, 32px) 5% min(2.3vw, 14px); color: #fff; font-size: clamp(16px, 3.5vw, 21px); }
  .syco-divider::before, .syco-divider::after { background: #626262; }
  html[data-page="login"] .syco-demo { min-height: clamp(40px, 9.8vw, 59px); width: max-content; max-width: 100%; padding: 6px min(8vw, 48px); border: 1.5px solid #f38c2f; border-radius: 999px; color: #f7f7f7; font-size: clamp(14px, 3.5vw, 18px); text-decoration: none; white-space: nowrap; }
  .syco-demo svg { display: block; }
  html[data-page="login"] .syco-field .field-error, html[data-page="login"] .syco-field .app-field-error { color: #ffabab; }
  html[data-page="login"] .syco-alert { border-color: #9c4747; background: #321c1c; color: #ffd2d2; }
}

html .color-mode-login { display: flex; margin: 0 0 28px auto; }

/* La misma paleta se utiliza a cualquier ancho del login. La imagen conserva la marca. */
html[data-color-mode][data-page="login"] .syco-login { background: var(--page-bg); color: var(--text-primary); }
html[data-color-mode][data-page="login"] .syco-login-card { background: var(--page-bg); }
html[data-color-mode][data-page="login"] .syco-panel { background: var(--page-bg); }
html[data-color-mode][data-page="login"] .syco-description { color: var(--text-secondary); }
html[data-color-mode][data-page="login"] .syco-title span { color: var(--accent); }
html[data-color-mode][data-page="login"] .syco-input { background: var(--card-bg); color: var(--text-primary); border-color: var(--border-color); color-scheme: inherit; }
html[data-color-mode][data-page="login"] .syco-input::placeholder { color: var(--text-secondary); opacity: 1; }
html[data-color-mode][data-page="login"] .syco-input:hover { border-color: var(--text-muted); }
html[data-color-mode][data-page="login"] .syco-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
html[data-color-mode][data-page="login"] :is(.syco-field-icon,.syco-toggle) { color: var(--text-secondary); }
html[data-color-mode][data-page="login"] .syco-checkbox { border-color: var(--text-muted); color-scheme: inherit; }
html[data-color-mode][data-page="login"] .syco-checkbox:checked { background: var(--accent); border-color: var(--accent); }
html[data-color-mode][data-page="login"] .syco-checkbox::before { border-color: var(--on-accent); }
html[data-color-mode][data-page="login"] .syco-forgot { color: var(--accent); }
html[data-color-mode][data-page="login"] .syco-submit { color: var(--on-accent); }
html[data-color-mode][data-page="login"] .syco-submit .spinner { border-color: currentColor; border-right-color: transparent; }
html[data-color-mode][data-page="login"] :is(.syco-divider,.syco-demo) { color: var(--text-secondary); }
html[data-color-mode][data-page="login"] .syco-divider::before,
html[data-color-mode][data-page="login"] .syco-divider::after { background: var(--border-color); }
html[data-color-mode][data-page="login"] .syco-field.has-error .syco-input { border-color: var(--error-text, #b71c1c); }
html[data-color-mode][data-page="login"] .syco-field :is(.field-error,.app-field-error) { color: var(--error-text, #b71c1c); }
html[data-color-mode="light"][data-page="login"] .syco-alert { background: #fff5f5; color: #b71c1c; border-color: #d78a8a; }
html[data-color-mode="dark"][data-page="login"] .syco-alert { background: #49272b; color: #ffb4b4; border-color: #885055; }

.syco-toggle .syco-eye-hidden { display: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
