/* LuxA palette ------------------------------------------------------------ */

:root {
  --luxa-naranja: #E9501D;      /* accent and primary actions */
  --luxa-ambar: #B24D04;        /* warm variant: the orange white text is legible on */
  --luxa-azul-oscuro: #0E3C59;  /* body text and dark surfaces */
  --luxa-azul-medio: #587589;   /* secondary: borders and rules, never text */
  --luxa-azul: #004572;         /* links and secondary text */

  --paper: #fff;
  --surface: #F3F5F7;
  --line: #D4DBE0;
  --touch: 48px;
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--luxa-azul-oscuro);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--luxa-azul-oscuro);
  outline-offset: 2px;
}

.header :focus-visible {
  outline-color: var(--paper);
}

/* Header ------------------------------------------------------------------ */

.header {
  background: var(--luxa-azul-oscuro);
  border-bottom: 4px solid var(--luxa-naranja);
}

.header__inner,
.main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.header__brand {
  color: var(--paper);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.header__brand em {
  color: var(--luxa-naranja);
  font-style: normal;
}

.header__signout {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.5rem;
  background: none;
  border: 0;
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Blocks ------------------------------------------------------------------ */

.page-title {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  line-height: 1.2;
}

.section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem;
}

.panel {
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel--narrow {
  max-width: 26rem;
  margin: 2rem auto;
}

.empty {
  padding: 1.5rem;
  background: var(--paper);
  border: 2px dashed var(--line);
  border-radius: 12px;
  color: var(--luxa-azul);
  text-align: center;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.flash--notice {
  background: #E6F0E9;
  border: 2px solid #14532D;
  color: #14532D;
}

.flash--alert {
  background: #FFF4EE;
  border: 2px solid var(--luxa-ambar);
  color: #7A3302;
}

/* login */
.page-lede {
  margin: -0.5rem 0 1.25rem;
  color: var(--luxa-azul);
  font-weight: 600;
}

.auth-help {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.auth-help p {
  margin: 0;
}

/* Sites ------------------------------------------------------------------- */

.site-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0 1rem 1rem;
}

.site-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 6px solid var(--luxa-naranja);
  border-radius: 10px;
}

.site-card--inactive {
  background: var(--surface);
  border-left-color: var(--luxa-azul-medio);
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.6rem;
  background: var(--luxa-azul-oscuro);
  border-radius: 999px;
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
}

.site-card__link {
  display: block;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
}

.site-card__name {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
}

a .site-card__name {
  text-decoration: underline;
}

.site-card__meta {
  color: var(--luxa-azul);
  font-weight: 600;
}

.progress {
  height: 14px;
  margin-top: 0.6rem;
  background: #DFE5E9;
  border-radius: 999px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--luxa-naranja);
}

.facts {
  margin: 0;
}

.facts dt {
  color: var(--luxa-azul);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.facts dd {
  margin: 0.15rem 0 1rem;
  font-size: 1.15rem;
}

/* Forms and buttons ------------------------------------------------------- */

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.field input:not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 0.6rem 0.75rem;
  background: var(--paper);
  border: 2px solid var(--luxa-azul-medio);
  border-radius: 8px;
  color: var(--luxa-azul-oscuro);
  font: inherit;
}

/* password field */
.password-field {
  position: relative;
}

.field .password-field input {
  padding-right: var(--touch);
}

.password-field__toggle {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--touch);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--luxa-azul-medio);
  cursor: pointer;
}

.password-field__toggle svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-field__toggle[aria-pressed="false"] .password-field__eye,
.password-field__toggle[aria-pressed="true"] .password-field__eye-off {
  display: none;
}

fieldset.field {
  padding: 0;
  border: 0;
}

fieldset.field legend {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.field--check label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--touch);
}

.field--check input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--luxa-azul-oscuro);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0.75rem 1.25rem;
  background: var(--luxa-ambar);
  border: 0;
  border-radius: 8px;
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button--wide {
  width: 100%;
}

.button--secondary {
  background: var(--paper);
  border: 2px solid var(--luxa-azul-oscuro);
  color: var(--luxa-azul-oscuro);
}

/* page actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--luxa-azul);
  font-weight: 600;
}

button.link {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Attachments ------------------------------------------------------------- */

.attachment-zones {
  display: grid;
  gap: 1rem;
}

.zone-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.zone-header h3 {
  margin: 0;
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.format-list li {
  padding: 0.125rem 0.625rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.file-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 10px;
}

.file-drop p {
  margin: 0;
  color: var(--luxa-azul);
}

.file-picker {
  position: relative;
  gap: 0.5rem;
}

.file-picker svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-picker:focus-within {
  outline: 3px solid var(--luxa-naranja);
  outline-offset: 2px;
}

/* hidden but focusable: the label is the button */
.file-picker__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.attachment-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.attachment-list:not(:has(li)) {
  display: none;
}

.attachment-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: baseline;
}

/* Just uploaded: fades by opacity only, so nothing moves */
.attachment--fresh::after {
  content: attr(data-notice);
  color: #14532D;
  font-weight: 700;
  animation: fresh-notice 4s forwards;
  animation-delay: inherit;
}

@keyframes fresh-notice {
  0%, 75% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .attachment--fresh::after { animation-timing-function: steps(1, end); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-list:not(:empty) {
  margin-top: 1rem;
}

.upload-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.upload-list progress {
  width: 100%;
  height: 14px;
  accent-color: var(--luxa-naranja);
}

.upload__name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.upload__status {
  white-space: pre-line;
}

.upload--failed progress {
  display: none;
}

.upload--failed .upload__status {
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: #FCEAE3;
  border-left: 6px solid var(--luxa-ambar);
  color: var(--luxa-ambar);
}
