/* Portal-specific styles. Colour and type come from the Ithildin UI library
   tokens (/lib/ithildin.css); this file lays out and themes the portal's own
   components. --gold is affordance only; --garnet marks negatives; the
   "stored" state is neutral (the vault confirms, it doesn't celebrate — and
   the palette has no green). */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

main {
  max-width: 608px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
}

/* The active screen is a card on the grey ground. Auto margins centre it, and
   collapse to 0 when the content outgrows the viewport, so a long file list
   just scrolls instead of clipping. */
main > section {
  width: 100%;
  margin-block: auto;
  padding: 40px 40px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.05);
}

h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 6px;
}

.h-shield {
  flex: none;
  width: 0.95em;
  height: 0.95em;
  color: var(--text);
}

.lede {
  margin: 0 0 28px;
  color: var(--text2);
}

/* Security assurance strip — three guarantees the infra actually backs, each a
   prominent token (what we promise) over a plain caption (what it means).
   Hairline dividers, neutral greys: it reassures, it doesn't advertise. */
.assurances {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.assure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 2px 8px;
  position: relative;
}

.assure + .assure::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* Sized to bracket the two text lines — top at the token's cap, bottom near the
   caption's baseline (the block measures ~28px). Kept just under the dropzone's
   26px icon so the footer stays subordinate to the primary affordance.
   Direct-child only, so the AWS logo's nested smile keeps its own size. */
.assure > svg {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--text2);
}

/* Vendor mark — the official AWS Cloud logo, monochrome (squid-ink) variant,
   self-hosted at /static so default-src 'self' covers it. Its viewBox is cropped
   to the mark (the tile's transparent padding is dropped) so it sizes like the
   stroke icons; 16px tall sits it at their visual weight without stealing cell
   width. */
.aws-logo {
  height: 16px;
  width: auto;
  flex: none;
}

.assure-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.assure-k {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.assure-v {
  font-size: 0.6875rem;
  letter-spacing: 0.01em;
  color: var(--text3);
  white-space: nowrap;
}

/* ---- login ---- */

label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text2);
  margin-bottom: 6px;
}

input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

input[type="email"]:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}

/* Clear the placeholder on focus, not just once typing starts. */
input[type="email"]:focus::placeholder {
  color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Primary CTA: dark neutral fill at rest, not gold. Gold is the focus ring. */
#send-link {
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--text);
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 150ms ease;
}

#send-link:hover {
  background: #000;
}

#send-link:disabled {
  opacity: 0.55;
  cursor: default;
}

.fineprint {
  margin: 14px 0 0;
  font-size: 0.78125rem;
  color: var(--text3);
}

/* Quiet success / info — neutral, never gold or garnet. */
.notice {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  color: var(--text2);
  font-size: 0.8125rem;
}

.error {
  margin-top: 14px;
  color: var(--garnet);
  font-size: 0.9375rem;
}

/* ---- dropzone ---- */

.dropzone {
  padding: 34px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
  color: var(--text2);
}

.dropzone.over {
  border-color: var(--gold);
  background: #faf7ef;
}

.dz-icon {
  width: 26px;
  height: 26px;
  color: var(--text2);
  margin-bottom: 8px;
}

.dropzone p {
  margin: 0 0 6px;
}

.file-label {
  display: inline;
  /* Override the generic `label` rule's 0.8125rem so it matches the paragraph. */
  font-size: inherit;
  color: var(--gold);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.dropzone .hint {
  margin-top: 10px;
  font-size: 0.78125rem;
  color: var(--text3);
}

/* The visible affordance is the label; the input itself stays reachable. */
#file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---- file list ---- */

.files {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Surface cards: leading doc icon · name+meta · trailing state. */
.file {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ficon {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  color: var(--text2);
}

.ficon svg {
  width: 18px;
  height: 18px;
}

.fname {
  grid-column: 2;
  font-size: 0.875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fmeta {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}

.fstate {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  align-self: center;
  font-size: 0.75rem;
  color: var(--text3);
}

.progress {
  display: flex;
  align-items: center;
  gap: 9px;
}

.progress .track {
  width: 96px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress .fill {
  height: 100%;
  width: 0;
  background: var(--gold);
  border-radius: 3px;
  transition: width 120ms ease;
}

.progress .pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}

/* "Stored" receipt — kept neutral (the palette has no green). */
.stored {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stored .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stored .chip svg {
  width: 11px;
  height: 11px;
}

.stored .rid {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text3);
}

.failed {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.failed .msg {
  color: var(--garnet);
  font-size: 0.8125rem;
}

.retry {
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.75rem;
  transition: color 150ms ease, border-color 150ms ease;
}

.retry:hover {
  color: var(--gold);
  border-color: var(--gold);
}
