/*
  TaleMontage | Mobile-first album intake
  ---------------------------------------------------------
  Scope every intake rule under .tm-intake.
  This is a presentation stylesheet, not a replacement for
  routing, Google Photos Picker, uploads, or server validation.

  View contract:
   - Under 760px render .tm-intake__choose OR .tm-intake__detail, never both; from 760px the choose cards stay above the detail.
   - Within Google Photos detail, show its action chooser OR
     the shared-link form, never both.
   - Use the actual app's handlers and accessibility semantics.
*/

.tm-intake {
  --tm-bg: #0c0b10;
  --tm-panel: #151319;
  --tm-tile: #201e25;
  --tm-tile-hover: #28242a;
  --tm-border: rgba(235, 226, 219, .17);
  --tm-text: #f6f1e9;
  --tm-muted: #a9a3ad;
  --tm-gold: #efa947;
  --tm-gold-dark: #cb8c36;
  --tm-glow: rgba(239, 169, 71, .18);
  --tm-focus: #ffd38c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tm-text);
  line-height: 1.45;
}

.tm-intake *, .tm-intake *::before, .tm-intake *::after { box-sizing: border-box; }
.tm-intake [hidden] { display: none !important; }
.tm-intake button, .tm-intake input { font: inherit; }
.tm-intake button { cursor: pointer; }
.tm-intake button:disabled { cursor: not-allowed; opacity: .48; }
.tm-intake :is(button, a, input, summary):focus-visible {
  outline: 2px solid var(--tm-focus);
  outline-offset: 3px;
}

.tm-intake__panel {
  position: relative;
  isolation: isolate;
  padding: 27px;
  border: 1px solid var(--tm-border);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(25,22,29,.98), rgba(16,14,21,.99));
  box-shadow: 0 20px 55px rgba(0,0,0,.23);
}
.tm-intake__title {
  margin: 0;
  color: var(--tm-text);
  font: 500 clamp(27px, 4.2vw, 36px)/1.14 Georgia, 'Times New Roman', serif;
  letter-spacing: -.032em;
  text-wrap: balance;
}
.tm-intake__intro { margin: 8px 0 22px; font-size: 14px; color: var(--tm-muted); }

/* Screen A: nothing but source choice and an alternate device-upload action. */
.tm-intake__choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.tm-intake__option {
  min-width: 0;
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 5px;
  border: 1px solid var(--tm-border);
  border-radius: 15px;
  background: var(--tm-tile);
  color: var(--tm-text);
  text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.tm-intake__option:hover { background: var(--tm-tile-hover); border-color: rgba(239,169,71,.5); }
.tm-intake__option:active { transform: scale(.98); }
.tm-intake__option-name { font-size: 12px; line-height: 1.2; font-weight: 570; overflow-wrap: normal; }
.tm-intake__provider-icon { display: grid; place-items: center; flex: none; width: 39px; height: 39px; border-radius: 50%; background: white; }
.tm-intake__provider-icon svg { width: 28px; height: 28px; display: block; }
.tm-intake__provider-icon--plain { background: transparent; }
.tm-intake__provider-icon--plain svg { width: 36px; height: 36px; }

.tm-intake__upload-option {
  grid-column: 1 / -1;   /* the last card of the grid: a full row on a phone, a tile of the wrap from 760px */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  min-height: 49px;
  margin-top: 2px;
  padding: 10px;
  border: 1px solid rgba(239,169,71,.72);
  border-radius: 13px;
  background: rgba(239,169,71,.055);
  color: var(--tm-text);
  font-size: 14px;
  font-weight: 640;
  transition: background .16s ease;
}
.tm-intake__upload-option:hover { background: rgba(239,169,71,.13); }
.tm-intake__upload-option svg { width: 19px; height: 19px; stroke: var(--tm-gold); }

/* Screen B: one provider, minimal context, immediately actionable controls. */
.tm-intake__back { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--tm-muted); border: 0; padding: 0; font-size: 13px; margin-bottom: 18px; }
.tm-intake__back[hidden] { display: none; }
.tm-intake__back:hover { color: var(--tm-text); }
.tm-intake__back svg { width: 15px; height: 15px; }
.tm-intake__provider-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.tm-intake__provider-heading .tm-intake__provider-icon { width: 46px; height: 46px; }
.tm-intake__provider-heading .tm-intake__provider-icon svg { width: 32px; height: 32px; }
.tm-intake__provider-title { font: 500 clamp(24px, 4vw, 30px)/1.1 Georgia, 'Times New Roman', serif; letter-spacing: -.02em; margin: 0; }
.tm-intake__provider-subtitle { margin: 5px 0 0; color: var(--tm-muted); font-size: 13px; }
.tm-intake__button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 49px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px; font-weight: 710; text-align: center;
  transition: filter .16s ease, background .16s ease;
}
.tm-intake__button:hover { filter: brightness(1.055); }
.tm-intake__button--primary { background: linear-gradient(95deg, #f4b356, #d89435); color: #17120e; }
.tm-intake__button svg { width: 18px; height: 18px; }
.tm-intake__field { display: block; margin: 18px 0 0; }
.tm-intake__field-label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.tm-intake__input-wrap { display: flex; align-items: center; padding: 4px; min-height: 49px; border: 1px solid rgba(242,229,219,.3); border-radius: 12px; background: #24212a; }
.tm-intake__input-wrap:focus-within { border-color: var(--tm-gold); box-shadow: 0 0 0 3px rgba(239,169,71,.1); }
.tm-intake__input { display: block; width: 100%; min-width: 0; border: 0; outline: 0; background: none; color: var(--tm-text); padding: 10px 10px; font-size: 14px; }
.tm-intake__input::placeholder { color: #827b86; }
.tm-intake__paste { flex: none; border: 1px solid rgba(239,169,71,.42); border-radius: 9px; background: rgba(239,169,71,.09); color: var(--tm-gold); padding: 8px 11px; font-size: 12px; }
.tm-intake__field-hint { margin: 7px 0 0; font-size: 12px; color: var(--tm-muted); }
.tm-intake__field-error { margin: 8px 0 0; font-size: 12px; color: #ffb49f; }
.tm-intake__help { margin: 14px 0; border-top: 1px solid var(--tm-border); border-bottom: 1px solid var(--tm-border); }
.tm-intake__help summary { list-style: none; color: var(--tm-gold); padding: 13px 2px; cursor: pointer; font-size: 13px; font-weight: 650; }
.tm-intake__help summary::-webkit-details-marker { display: none; }
.tm-intake__help summary::after { content: '+'; float: right; }
.tm-intake__help[open] summary::after { content: '−'; }
.tm-intake__help-content { font-size: 13px; color: var(--tm-muted); padding: 0 2px 13px; }
.tm-intake__help-content ol { margin: 0 0 12px; padding-inline-start: 20px; }
.tm-intake__help-content li + li { margin-top: 6px; }
.tm-intake__external { color: var(--tm-gold); text-decoration: underline; text-underline-offset: 3px; }
.tm-intake__small-privacy { color: var(--tm-muted); font-size: 12px; margin: 12px 0 0; }
.tm-intake__small-privacy details summary { cursor: pointer; }
.tm-intake__small-privacy details p { margin: 7px 0 0; }


@media (min-width: 760px) {
  .tm-intake__panel { padding: 34px; }
  /* Wraps by the width there is (4 + 3 at 760, the seventh being the upload card; one row of 7 from about 1000) instead of squeezing six names into 100 px. */
  .tm-intake__choice-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  /* The chosen source's page under the cards, which stay. */
  .tm-intake__detail { margin-block-start: 26px; padding-block-start: 22px; border-block-start: 1px solid var(--tm-border); }
  .tm-intake__option { min-height: 116px; }
  .tm-intake__option-name { font-size: 13px; }
  .tm-intake__upload-option { grid-column: auto; flex-direction: column; min-height: 116px; margin: 0; padding: 12px 5px; border-radius: 15px; font-size: 13px; }
  .tm-intake__detail-inner { max-width: 550px; margin: auto; }
}
@media (max-width: 380px) {
  .tm-intake__panel { padding: 19px 16px; border-radius: 18px; }
  .tm-intake__title { font-size: 27px; }
  .tm-intake__option { min-height: 100px; gap: 8px; }
  .tm-intake__option-name { font-size: 11.5px; }
  .tm-intake__choice-grid { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-intake *, .tm-intake *::before, .tm-intake *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
