/* Warm family album. Light only: relatives' phones force dark mode at random
   and an inverted photo page reads as broken. */
:root {
  color-scheme: light;
  --bg:      #F6EDE1;
  --card:    #FFFCF7;
  --ink:     #3B2E26;
  --muted:   #806A5A;
  --line:    #E9DAC7;
  --accent:  #C2603C;
  --accent-d:#A44E2E;
  --ok:      #5F8A4C;
  --ok-bg:   #EDF3E6;
  --warn:    #B3462F;
  --radius:  18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}

/* Soft light from the top, like an old photo under a lamp. */
.warmth {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, #FFE8CC 0%, rgba(255,232,204,0) 60%),
    radial-gradient(80% 50% at 110% 100%, #F3DCC4 0%, rgba(243,220,196,0) 55%);
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px calc(48px + env(safe-area-inset-bottom));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px 32px;
  box-shadow: 0 1px 2px rgba(90,60,35,.05), 0 12px 32px -18px rgba(90,60,35,.35);
}

.card.center { text-align: center; }

.mark {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 14px;
}

h1 {
  font: 600 30px/1.2 Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  margin: 0 0 12px;
  letter-spacing: -.01em;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 17px;
}

.hint, .privacy {
  color: var(--muted);
  font-size: 14.5px;
  margin: 14px 0 0;
}

.privacy { margin-top: 22px; }

.error {
  background: #FBE9E4;
  border: 1px solid #F0CBBF;
  color: var(--warn);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 18px;
  font-size: 15.5px;
}

/* ---------- controls ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 16px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: 600 18px/1.2 inherit;
  cursor: pointer;
  transition: background .15s ease, transform .06s ease;
}

.btn:hover  { background: var(--accent-d); }
.btn:active { transform: translateY(1px); }

.btn-big {
  min-height: 68px;
  font-size: 20px;
  box-shadow: 0 8px 20px -10px rgba(194,96,60,.9);
}

.btn-name {
  background: #FFF7EC;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-size: 19px;
}

.btn-name:hover {
  background: #FFF1DF;
  border-color: #DCC4A8;
}

.gate label {
  display: block;
  text-align: left;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
}

.gate input {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 19px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
}

.gate input:focus,
.year select:focus {
  outline: 3px solid #F0CFAE;
  border-color: #D9B491;
}

.who {
  display: grid;
  gap: 12px;
}

/* Optional and secondary: sits below the primary button, closed by default. */
.year {
  margin: 18px 0 0;
  font-size: 15px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.year summary {
  cursor: pointer;
  color: var(--accent);
  padding: 4px 0;
  list-style-position: inside;
}

.year label { display: block; margin-top: 12px; }
.year span { display: block; margin-bottom: 6px; }
.year .hint { margin-top: 8px; font-size: 13.5px; }

.year select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
}

.whoami {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--muted);
}

.whoami a { color: var(--accent); }

/* ---------- upload progress ---------- */

.status {
  margin: 22px 0 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #FFF3E2;
  border: 1px solid #F0DCC0;
  font-size: 16px;
}

.status.done {
  background: var(--ok-bg);
  border-color: #CFE0C0;
  color: #3F5E31;
  font-weight: 600;
}

.files {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.files li {
  display: grid;
  /* minmax(0,1fr), not 1fr: a long filename or error must not widen the row. */
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
}

.files .icon { font-size: 18px; text-align: center; }
.files .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.files .state {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  justify-self: end;
}

.files li.done  { background: var(--ok-bg); border-color: #D5E4C7; }
.files li.done .state { color: #4C7239; font-weight: 600; }

/* A rejection needs a full sentence, so it gets its own wrapping row. */
.files li.failed { background: #FBE9E4; border-color: #F0CBBF; }
.files li.failed .state {
  grid-column: 1 / -1;
  justify-self: stretch;
  white-space: normal;
  color: var(--warn);
  line-height: 1.45;
}

/* The bar only means anything while bytes are moving. */
.files li.done .bar,
.files li.failed .bar { display: none; }

.bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: #F0E3D2;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}

.already {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  color: var(--muted);
}

@media (min-width: 560px) {
  .wrap { padding-top: 48px; }
  h1 { font-size: 34px; }
  .card { padding: 36px 34px 40px; }
}
