/*
 * La Guisera welcome / sign-in page (LG-001, LG-002).
 *
 * Layout breakpoints, in source order:
 *   >= 1500px wide               large desktop
 *   761px to 1050px wide         narrow desktop / tablet
 *   <= 760px wide                mobile: hero stacks above the form
 *   <= 370px wide                narrow phone
 *   >= 761px wide, <= 800px tall short desktop
 * Rules that overlap (a large or narrow desktop that is also short) resolve
 * by source order, so the short-desktop block must stay after the width blocks.
 *
 * The Home design preview (home-preview/index.html) is self-contained and does
 * not load this file.
 */

/* ---------- Tokens and base ---------- */

:root {
  color-scheme: dark;
  --bg: #100e1c;
  --text: #f7f5fc;
  --muted: #8d889f;
  --accent: #bda3ff;
  --line: #302b40;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #d3c0ff;
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Author display rules must never reveal an element marked hidden. */
[hidden] {
  display: none !important;
}

h1,
h2 {
  font-family: Manrope, sans-serif;
}

p {
  line-height: 1.7;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.3px;
  color: #aaa0be;
}

.eyebrow > span {
  width: 15px;
  height: 1px;
  background: var(--accent);
}

.text-button {
  border: 0;
  padding: 0;
  background: none;
  color: #c4b2e4;
  font-size: 11px;
}

.text-button:hover {
  color: #eee4ff;
}

.text-button span {
  margin-left: 4px;
}

/* ---------- Page layout ---------- */

.shell {
  display: grid;
  grid-template-columns: 53% 47%;
  max-width: 1920px;
  min-height: 100svh;
  margin: auto;
}

/* ---------- Hero ("world") panel ---------- */

.world {
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
  min-height: 820px;
  background: radial-gradient(ellipse at 47% 36%, #31205e55, transparent 60%), #121020;
  border-right: 1px solid #ffffff0b;
}

.brand {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  margin: 43px 8%;
  font-family: Manrope, sans-serif;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -1.1px;
}

.brand-icon {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #121020;
}

.brand-period {
  color: var(--accent);
}

/* Decorative background: generated stars (app.js) and a soft nebula glow. */
.cosmos {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #ded3ff;
  box-shadow: 0 0 8px #c7b0ff66;
  animation: twinkle 7s ease-in-out infinite alternate;
}

.nebula {
  position: absolute;
  left: 5%;
  top: 10%;
  width: 95%;
  height: 65%;
  background: radial-gradient(ellipse, #6837a52b, transparent 65%);
  filter: blur(28px);
}

/* Cosmic cauldron hero: the artwork gets its own space above the copy. */
.hero-art {
  position: relative;
  flex: 1;
  align-self: center;
  width: 92%;
  min-height: 420px;
  margin-top: 0;
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 36px #8e42d51a);
}

.hero-copy {
  position: relative;
  margin: 0 8%;
  padding-top: 0;
}

h1 {
  margin: 22px 0 17px;
  font-size: clamp(32px, 3.5vw, 57px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -2.2px;
}

h1 > span {
  color: #b9a0e7;
}

.hero-copy p {
  margin: 0;
  font-size: 13px;
  color: #9a91ac;
}

.world-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 8% 28px;
  font-size: 9px;
  color: #777086;
}

.orbit-mini {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 25px;
  font-size: 9px;
  color: #b8a8cf;
}

@keyframes twinkle {
  from {
    opacity: 0.25;
  }

  to {
    opacity: 0.85;
  }
}

/* ---------- Sign-in panel ---------- */

.login-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 60px;
  background: radial-gradient(ellipse at 100% 0, #251b342b, transparent 45%);
}

.form-wrap {
  width: min(360px, 76%);
  margin: auto;
  padding: 48px 0 38px;
}

.welcome-symbol {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 27px;
  border: 1px solid #3d305355;
  border-radius: 14px;
  background: #211b32;
  color: #c7adff;
  font-size: 39px;
  line-height: 1;
}

.form-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 1.9px;
  color: #a69ab9;
}

.form-heading h2 {
  margin: 10px 0 8px;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -1.6px;
}

.form-heading h2 span {
  color: var(--accent);
}

.form-heading p {
  margin: 0;
  font-size: 12px;
  color: #8f879e;
}

.signin-form {
  margin-top: 30px;
}

.field {
  margin-bottom: 19px;
}

.field > label {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  color: #d3ccdf;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #30293d;
  border-radius: 8px;
  background: #191623;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
  border-color: #ae91e1;
  box-shadow: 0 0 0 3px #ab88dd12;
}

/*
 * outline: none here also cancels the input:focus-visible outline above
 * (same specificity, later rule). The field's only focus cue is the
 * .input-wrap:focus-within border. Kept as-is; tracked as QA-002.
 */
.input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 15px 12px 15px 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f6f1ff;
  font-size: 11px;
  line-height: 18px;
  outline: none;
}

.input-wrap input::placeholder {
  color: #736b82;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: #837790;
  stroke: currentColor;
  stroke-width: 1.4;
  pointer-events: none;
}

.eye-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #8d809d;
}

.eye-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.4;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 24px;
}

.form-options .text-button {
  font-size: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #a59aaf;
  cursor: pointer;
}

.checkbox-label input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin: 0;
  border: 1px solid #51445f;
  border-radius: 3px;
  background: #1c1728;
}

.checkbox-label input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.checkbox-label input:checked::after {
  content: '✓';
  font-size: 10px;
  color: #221733;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 18px;
  border: 1px solid #c4aaff;
  border-radius: 8px;
  background: #bba1f0;
  box-shadow: 0 4px 20px #a785ed0b;
  color: #21152f;
  font-size: 12px;
  font-weight: 650;
  transition: background 0.2s, transform 0.2s;
}

.primary-button:hover {
  background: #ccb4fc;
  transform: translateY(-1px);
}

.primary-button > span:last-child {
  font-size: 18px;
  font-weight: 400;
  line-height: 14px;
}

.form-feedback {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #4f3e65;
  border-radius: 8px;
  background: #241c32;
  color: #c3b3df;
  font-size: 11px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 25px 0 20px;
  font-size: 9px;
  color: #786e87;
}

.divider span {
  flex: 1;
  height: 1px;
  background: #2c2538;
}

.socials {
  display: flex;
  gap: 12px;
}

.socials button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 9px;
  padding: 12px;
  border: 1px solid #342b42;
  border-radius: 8px;
  background: #191522;
  font-size: 11px;
  transition: background 0.2s;
}

.socials button:hover {
  background: #292033;
}

.socials svg {
  width: 16px;
  height: 16px;
}

.back-to-signin {
  display: block;
  margin: 24px auto 0;
}

.demo-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 22px 0 0;
  font-size: 8px;
  color: #776c86;
}

.demo-note > span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8d76b0;
}

.panel-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8% 28px;
  font-size: 9px;
  color: #6f657e;
}

.panel-footer .text-button {
  font-size: 9px;
  color: #8b7e9d;
}

/* ---------- Preview dialog ---------- */

dialog {
  width: calc(100% - 36px);
  max-width: 430px;
  padding: 36px;
  border: 1px solid #57426b;
  border-radius: 18px;
  background: #1a1427;
  box-shadow: 0 30px 100px #0009;
  color: #f6f1ff;
}

dialog::backdrop {
  background: #080510bb;
  backdrop-filter: blur(9px);
}

dialog h2 {
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: -1px;
}

dialog p {
  font-size: 13px;
  color: #b9abc8;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: #b6a2c8;
  font-size: 25px;
}

.dialog-done {
  margin-top: 25px;
}

/* ---------- Large desktop ---------- */

@media (min-width: 1500px) {
  .world {
    min-height: 100svh;
  }

  .hero-art {
    min-height: 470px;
    max-height: 660px;
  }

  .hero-copy {
    margin-top: auto;
  }

  .form-wrap {
    width: 390px;
  }

  .form-heading h2 {
    font-size: 40px;
  }
}

/* ---------- Narrow desktop / tablet ---------- */

@media (min-width: 761px) and (max-width: 1050px) {
  .shell {
    grid-template-columns: 49% 51%;
  }

  h1 {
    font-size: 36px;
    letter-spacing: -1.5px;
  }

  .form-wrap {
    width: 78%;
  }

  .form-heading h2 {
    font-size: 31px;
  }
}

/* ---------- Short desktop (after the width blocks: it wins overlaps) ---------- */

@media (min-width: 761px) and (max-height: 800px) {
  .world {
    min-height: 100svh;
  }

  .brand {
    margin-bottom: 8px;
  }

  h1 {
    margin-top: 16px;
    margin-bottom: 12px;
  }

  .world-footer {
    margin-top: 24px;
  }

  .form-wrap {
    padding: 25px 0 24px;
  }

  .welcome-symbol {
    width: 34px;
    height: 34px;
    margin-bottom: 18px;
    font-size: 31px;
  }

  .form-heading h2 {
    font-size: 33px;
  }

  .field {
    margin-bottom: 15px;
  }

  .form-options {
    margin-bottom: 19px;
  }

  .divider {
    margin: 20px 0 16px;
  }

  .demo-note {
    margin-top: 15px;
  }

  .hero-art {
    min-height: 350px;
  }
}

/* A large desktop that is also short keeps the large hero height. */
@media (min-width: 1500px) and (max-height: 800px) {
  .hero-art {
    min-height: 470px;
  }
}

/* ---------- Mobile: hero stacks above the form ---------- */

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .world {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #ffffff0c;
  }

  .brand {
    gap: 9px;
    margin: 26px 7% 0;
    font-size: 22px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .cosmos {
    opacity: 0.7;
  }

  .nebula {
    top: 15%;
    height: 60%;
  }

  .hero-art {
    flex: none;
    width: 100%;
    height: 340px;
    min-height: 0;
    margin-top: 4px;
  }

  .hero-copy {
    z-index: 1;
    margin: 8px 7% 30px;
    pointer-events: none;
  }

  .hero-copy .eyebrow {
    font-size: 8px;
    text-shadow: 0 1px 4px #100e1c;
  }

  h1 {
    margin: 14px 0 12px;
    font-size: 33px;
    letter-spacing: -1.4px;
    text-shadow: 0 2px 20px #100e1c;
  }

  h1 > span {
    color: #c4acef;
  }

  .hero-copy p {
    font-size: 12px;
    text-shadow: 0 1px 6px #100e1c;
  }

  .world-footer {
    display: none;
  }

  .login-panel {
    padding-top: 7px;
  }

  .form-wrap {
    width: min(400px, 86%);
    margin: 0 auto;
    padding: 27px 0 34px;
  }

  .welcome-symbol {
    display: none;
  }

  .form-heading h2 {
    font-size: 34px;
  }

  .field > label {
    font-size: 12px;
  }

  /* 16px prevents iOS from zooming into the field on focus. */
  .input-wrap input {
    padding-top: 13px;
    padding-bottom: 13px;
    font-size: 16px;
  }

  .checkbox-label,
  .form-options .text-button {
    font-size: 11px;
  }

  .socials button {
    font-size: 12px;
  }

  .demo-note {
    font-size: 9px;
  }

  .panel-footer {
    padding: 0 7% 24px;
    font-size: 10px;
  }

  .panel-footer .text-button {
    font-size: 10px;
  }
}

/* ---------- Narrow phone ---------- */

@media (max-width: 370px) {
  h1 {
    font-size: 29px;
  }

  .hero-art {
    height: 300px;
  }

  .form-heading h2 {
    font-size: 31px;
  }

  .form-options {
    gap: 5px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* MCP consent page (/oauth/consent, MCP.md) */
.consent-body {
  margin-top: 26px;
}

.form-heading h2 #consent-title-text {
  color: var(--text);
}

.consent-app,
.consent-label,
.consent-return,
.consent-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #a69ab9;
}

.consent-app strong {
  color: var(--text);
  font-weight: 650;
}

.consent-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.consent-list li {
  margin-bottom: 8px;
  padding: 11px 14px;
  border: 1px solid #342b42;
  border-radius: 8px;
  background: #191522;
  font-size: 12px;
}

.consent-return {
  color: #8f879e;
}

.consent-deny {
  display: block;
  margin: 14px auto 18px;
}

.consent-hint {
  font-size: 11px;
  color: #8f879e;
  text-align: center;
}
