/* The family's pages — sign-in, and (Task 9) the veteran's page.
 * A small sheet hanging off the tokens declared at the top of /styles.css;
 * nothing here is a magic value that isn't a token there. */

.portal-main {
  max-width: 42rem;
  margin-inline: auto;
  padding: var(--sp-5) var(--edge);
}

.portal-main h1 { margin-bottom: var(--sp-2); }
.portal-main .lede { margin-bottom: var(--sp-3); }
.portal-main > p { margin-top: var(--sp-2); }

.portal-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  max-width: 26rem;
}

.portal-form label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.portal-form input {
  font: inherit;
  font-size: 1rem; /* >=17px in practice once the fluid base scale is applied */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  min-height: 44px;
}

.portal-form input:hover { border-color: var(--ink-soft); }
.portal-form input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px oklch(0.735 0.115 74 / 0.22);
}
.portal-form input:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.portal-form button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-0);
  min-height: 44px;
  padding: 0.85em 1.6em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brass);
  color: oklch(0.24 0.03 60);
  box-shadow: var(--shadow-1);
}
.portal-form button:hover { box-shadow: var(--shadow-2); }
.portal-form button:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

/* A real sentence, not a colour swatch — role="alert" carries it to a screen
 * reader, and the wording itself (not the tint) is what tells a reader
 * something went wrong. */
.error {
  color: var(--danger);
  font-weight: 500;
}

.quiet {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin-top: var(--sp-4);
}

.back {
  color: var(--ink-soft);
  font-size: 0.94rem;
  text-decoration: underline;
}

/* The sentence a family came to read. Weight and size carry the meaning, not
 * colour alone — the wording itself ("We're looking...") is the signal. */
.status {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink);
  margin-top: var(--sp-1);
}

.facts {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.fact {
  padding-block: var(--sp-1);
  border-bottom: 1px solid var(--line);
}

.fact dt {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.fact dd {
  margin: 0.2em 0 0;
  font-size: var(--step-0);
  line-height: 1.5;
}

.requests {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.requests li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1);
  padding: var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.requests a {
  font-size: var(--step-0);
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.requests .status {
  font-size: 0.94rem;
  font-weight: 500;
  margin-top: 0;
}

.signout { margin-top: var(--sp-4); }

/* A real <button> inside a real <form method="post">, styled to read as a
 * plain link — sign-out must be a POST, not a GET a link prefetch could fire. */
.link-button {
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 0;
  min-height: 44px;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover { color: var(--ink); }
.link-button:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

/* Correspondence, not a chat app — a plain list read top to bottom, not a
 * stack of bubbles. "mine" vs "theirs" is carried by the byline naming who
 * spoke and a rule down one side, never by colour alone. */
.thread {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.entry {
  padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--line-2);
}

.entry.mine { border-left-color: var(--brass-deep); }

.byline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.3em;
}

.byline .quiet { margin-top: 0; font-size: inherit; font-weight: 500; }

.said {
  font-size: var(--step-0);
  line-height: 1.5;
  white-space: pre-wrap;
}

.sent {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1);
  font-size: var(--step-0);
}

.sent a {
  font-weight: 600;
  text-decoration: underline;
}

.inline { display: inline; }

.say {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  max-width: 34rem;
}

.say label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.say textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  resize: vertical;
}

.say textarea:focus,
.say input[type="file"]:focus-visible {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px oklch(0.735 0.115 74 / 0.22);
}

.say input[type="file"] {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  min-height: 44px;
}

.help {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}

.say button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-0);
  min-height: 44px;
  padding: 0.85em 1.6em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brass);
  color: oklch(0.24 0.03 60);
  box-shadow: var(--shadow-1);
}

.say button:hover { box-shadow: var(--shadow-2); }
.say button:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

/* The dropzone sits in front of the real <input type="file">, which is only
 * ever hidden by the script that renders this element — see .visually-hidden.
 * The sentence, not an icon, is what tells someone who has never dragged a
 * file what to do; the box itself is just a dashed-border affordance. */
.dropzone {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  transition: border-color 0.15s ease, border-width 0.15s ease;
}

/* Over-state is carried by border weight as well as colour — a family
 * relying on colour alone (or a monitor rendering it greyscale) still gets
 * the signal that the drop will land here. */
.dropzone.over {
  border-width: 3px;
  border-color: var(--brass);
}

@media (prefers-reduced-motion: reduce) {
  .dropzone { transition: none; }
}

.dropzone-say {
  font-size: var(--step-0);
  color: var(--ink);
  margin: 0;
}

.dropzone-list {
  list-style: none;
  margin: var(--sp-1) 0 0;
  padding: 0;
  font-size: var(--step-0);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

/* Clipped, not display:none — the input stays focusable and stays part of
 * the form. Only the script ever adds this class, so with JS off the plain
 * <input type="file"> is exactly what's on the page. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
