@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600&display=swap');

:root {
  color-scheme: light;
  --ink: #33392b;
  --muted: #74786a;
  --olive: #586343;
  --olive-dark: #414b32;
  --sage: #e5e9df;
  --paper: #fbfaf6;
  --line: #e4e4da;
  --error: #9b4238;
  --instagram-gradient: linear-gradient(110deg, #833ab4, #b52d87 55%, #d62976);
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #f3f2eb;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at top, #fbfaf6, #f1f0e9 75%); }
.page-shell { max-width: 680px; margin: 0 auto; padding: 24px 18px 28px; }
.upload-card { overflow: hidden; border: 1px solid rgba(74, 84, 56, .12); border-radius: 22px; background: var(--paper); box-shadow: 0 18px 60px rgba(53, 60, 41, .09); }
.artwork { height: clamp(160px, 43vw, 245px); background: linear-gradient(180deg, rgba(31, 44, 24, .02) 35%, rgba(34, 42, 27, .26)), url('arte-casal.webp') center 39% / cover; }
.card-content { padding: 27px clamp(22px, 6vw, 42px) 29px; }
.eyebrow { margin: 0 0 12px; color: var(--olive); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.eyebrow span { display: block; margin-top: 7px; color: var(--muted); font-size: .65rem; letter-spacing: .12em; font-weight: 500; }
h1, h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; }
h1 { max-width: 420px; margin: 0 auto; font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.12; text-align: center; }
.intro { max-width: 410px; margin: 14px auto 25px; color: #66695d; font-size: .96rem; line-height: 1.65; text-align: center; }
.field-label { display: block; margin: 17px 0 8px; font-size: .9rem; font-weight: 700; }
.field-label span { color: var(--muted); font-size: .83rem; font-weight: 400; }
.button { min-height: 54px; width: 100%; border: 0; border-radius: 12px; font: inherit; font-size: .98rem; font-weight: 700; cursor: pointer; transition: background .15s, transform .15s, opacity .15s; }
.button:active { transform: translateY(1px); }
.button:focus-visible, .text-input:focus-visible, .remove-file:focus-visible { outline: 3px solid #a8b28f; outline-offset: 3px; }
.button-primary { color: white; background: var(--olive); }
.button-primary:hover { background: var(--olive-dark); }
.button-send { margin-top: 18px; color: white; background: var(--olive-dark); }
.button:disabled { cursor: not-allowed; opacity: .47; }
.microcopy { margin: 9px 0 14px; color: var(--muted); font-size: .79rem; line-height: 1.5; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); border: 0; }
.file-section { margin: 17px 0 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.file-summary { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; }
.file-summary strong { color: var(--ink); }
.total-progress-wrap { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: .76rem; }
.total-progress-wrap progress { width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 10px; background: #eeefe9; accent-color: var(--olive); }
.total-progress-wrap progress::-webkit-progress-bar { border-radius: 10px; background: #eeefe9; }
.total-progress-wrap progress::-webkit-progress-value { border-radius: 10px; background: var(--olive); }
.total-progress-wrap progress::-moz-progress-bar { border-radius: 10px; background: var(--olive); }
.total-progress-wrap span { min-width: 74px; text-align: right; }
.file-list { max-height: 240px; overflow: auto; padding: 0; margin: 8px 0 0; list-style: none; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 9px; row-gap: 5px; padding: 10px 0; border-top: 1px solid #f0f0ea; font-size: .82rem; }
.file-row .file-name { grid-column: 1; grid-row: 1; }
.file-row .file-size { grid-column: 1; grid-row: 2; white-space: normal; overflow-wrap: anywhere; }
.file-row .remove-file { grid-column: 2; grid-row: 1 / span 2; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); white-space: nowrap; }
.remove-file { min-width: 40px; min-height: 40px; padding: 5px 10px; border: 0; border-radius: 8px; color: var(--olive-dark); background: var(--sage); font: inherit; font-weight: 700; cursor: pointer; }
.form-fields { margin-top: 18px; }
.text-input { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid #dcded4; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; font-size: 1rem; }
.text-input::placeholder { color: #9a9c92; }
.note-input { min-height: 90px; resize: vertical; }
.instagram-account-block { margin: 18px 0 20px; }
.hashtag-picker { margin: 18px 0 20px; padding: 16px; border: 1px solid #ead9e5; border-radius: 14px; background: #fffafd; }
.hashtag-picker h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 1.2rem; }
.hashtag-picker .microcopy { margin: 0 0 12px; }
.hashtag-options { display: flex; flex-wrap: wrap; gap: 8px; }
.hashtag-choice { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 11px; border: 1px solid #e5cfdd; border-radius: 999px; background: #fff; color: #81255f; font-size: .9rem; }
.hashtag-choice input { accent-color: #a72d83; width: 17px; height: 17px; margin: 0; }
.hashtag-choice.is-fixed { background: #f5eaf1; font-weight: 700; }
.add-hashtag-controls { margin-top: 15px; }
.add-hashtag-row { display: flex; align-items: center; gap: 8px; }
.add-hashtag-row > span { font-weight: 700; color: #90246b; }
.add-hashtag-row .text-input { flex: 1 1 0; width: auto; min-width: 0; }
.add-hashtag-row .button { flex: 0 0 auto; width: auto; min-height: 46px; padding: 0 14px; }
.hashtag-picker #hashtag-status:empty { display: none; }
.upload-instagram-account { margin: 0 0 20px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.new-upload-button { display: block; min-height: 42px; margin: 0 0 12px auto; padding: 7px 12px; border: 1px solid #d5dacb; border-radius: 9px; color: var(--olive-dark); background: var(--sage); font-weight: 700; }
.new-upload-button:hover { background: #dce3d2; }
.upload-details { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }
.instagram-account-field { display: flex; align-items: center; gap: 4px; padding-left: 12px; border: 1px solid #dcded4; border-radius: 10px; background: #fff; }
.instagram-account-field:focus-within { outline: 3px solid #a8b28f; outline-offset: 3px; }
.instagram-account-prefix { flex-shrink: 0; color: var(--muted); font-size: .85rem; }
.instagram-account-input { flex: 1; min-width: 0; width: 0; border: 0; padding-left: 4px; background: transparent; }
.instagram-account-input:focus-visible { outline: none; }
.instagram-account-input:disabled { opacity: .6; }
.instagram-account-block .microcopy { text-align: left; }
.additional-instagram-list { display: grid; gap: 8px; margin-top: 9px; }
.additional-instagram-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.remove-instagram-account { min-height: 42px; padding: 7px 10px; border: 0; border-radius: 8px; color: var(--olive-dark); background: var(--sage); font: inherit; font-size: .76rem; cursor: pointer; }
.remove-instagram-account:disabled { opacity: .45; cursor: default; }
.add-account-button { margin-top: 5px; padding-inline: 0; color: #90246b; font-weight: 700; }
.status-message { min-height: 21px; margin: 10px 2px 0; color: var(--muted); font-size: .82rem; line-height: 1.5; text-align: center; }
.status-message.is-error { color: var(--error); }
.privacy-note { margin: 24px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; line-height: 1.55; text-align: center; }
.success-area { padding: 27px 0 8px; text-align: center; }
.success-mark { display: grid; width: 55px; height: 55px; margin: 0 auto 15px; place-items: center; border-radius: 50%; color: var(--olive-dark); background: var(--sage); font-size: 1.5rem; }
.success-area h2 { margin: 0 auto; font-size: 1.65rem; line-height: 1.25; }
.success-area p { margin: 10px 0 22px; color: var(--muted); font-size: .9rem; }
footer { padding: 18px 0 0; color: var(--muted); font-family: 'Playfair Display', Georgia, serif; font-size: .91rem; text-align: center; }

@media (max-width: 400px) {
  .page-shell { padding: 12px 10px 20px; }
  .upload-card { border-radius: 16px; }
  .artwork { height: 160px; }
  .card-content { padding: 22px 19px 24px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; } }

[hidden] { display: none !important; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
.step-tabs { display: grid; grid-template-columns: 1fr 1.25fr; padding: 5px; gap: 5px; margin: 25px 0; border: 1px solid var(--line); border-radius: 14px; background: #f0f1e9; }
.step-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 8px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font: inherit; font-size: .79rem; line-height: 1.35; cursor: pointer; }
.step-tab[aria-selected="true"] { color: var(--olive-dark); background: var(--paper); box-shadow: 0 2px 7px #33392b0c; font-weight: 700; }
.step-tab:disabled { opacity: .6; cursor: default; }
.step-number { display: grid; place-items: center; flex-shrink: 0; width: 23px; height: 23px; border: 1px solid #b9c0ac; border-radius: 50%; font-size: .7rem; }
.step-tab[aria-selected="true"] .step-number { color: white; border-color: var(--olive); background: var(--olive); }
#instagram-tab[aria-selected="true"] { color: #90246b; background: #fff6fb; }
.step-tab:focus-visible, .text-button:focus-visible, .instagram-link:focus-visible { outline: 3px solid #a8b28f; outline-offset: 2px; }
.button-secondary { margin-top: 10px; color: var(--olive-dark); border: 1px solid #d5dacb; background: transparent; font-size: .88rem; }
.button-secondary:hover { background: var(--sage); }
.next-step-note { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 17px 0 0; color: var(--olive); font-size: .8rem; line-height: 1.6; }
.next-step-note span { font-size: 1.7rem; }
.saved-notice { display: grid; grid-template-columns: 34px 1fr; align-items: start; gap: 12px; padding: 20px; border-radius: 14px; background: var(--sage); }
.notice-heart { font-size: 2rem; line-height: 1; }
.saved-notice strong { font-size: .94rem; }
.saved-notice p { margin: 8px 0 2px; color: #66695d; font-size: .87rem; line-height: 1.6; }
.saved-notice button { grid-column: 1 / -1; }
.gallery-heading { text-align: center; }
.received-pill { display: inline-flex; gap: 7px; align-items: center; padding: 7px 11px; border-radius: 30px; color: var(--olive-dark); background: var(--sage); font-size: .71rem; }
.gallery-heading h2 { margin: 19px 0 12px; font-size: clamp(1.65rem, 6vw, 2rem); line-height: 1.2; }
.gallery-heading p { margin: 0 0 20px; color: #66695d; font-size: .9rem; line-height: 1.7; }
.gallery-hint { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.gallery-toolbar { display: grid; gap: 8px; margin: 16px 0 14px; }
.selection-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.selection-actions .text-button { padding: 8px; border: 1px solid #e9c5dd; border-radius: 9px; color: #90246b; background: #fff6fb; font-weight: 600; }
.gallery-toolbar p { margin: 0; color: var(--olive-dark); font-weight: 600; font-size: .8rem; }
.text-button { flex-shrink: 0; min-height: 44px; padding: 5px; border: 0; color: var(--olive); background: transparent; font: inherit; font-size: .75rem; cursor: pointer; }
.text-button:disabled { opacity: .4; cursor: default; }
.media-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.memory-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; transition: border-color .15s, box-shadow .15s; }
.memory-card.is-selected { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.memory-card.has-date-entry.is-selected { grid-column: 1 / -1; }
.memory-card.has-date-entry.is-selected .memory-image { aspect-ratio: 16 / 9; max-height: 220px; overflow: hidden; }
.memory-card.has-date-entry.is-selected .memory-image img { height: 100%; aspect-ratio: 16 / 9; }
.memory-choice { display: block; position: relative; cursor: pointer; }
.memory-choice input { position: absolute; z-index: 2; top: 10px; right: 10px; width: 25px; height: 25px; margin: 0; accent-color: var(--olive); cursor: pointer; }
.memory-choice:focus-within { outline: 3px solid #a8b28f; outline-offset: -3px; border-radius: 12px; }
.memory-image { display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: #eef0e7; }
.memory-image img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.preview-placeholder { padding: 17px; color: var(--muted); font-size: .8rem; line-height: 1.6; text-align: center; }
.memory-kind { position: absolute; left: 8px; top: 10px; padding: 5px 8px; border-radius: 20px; color: white; background: #33392ba8; font-size: .65rem; }
.memory-caption { display: block; padding: 12px 11px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; font-weight: 600; }
.memory-prompt { display: block; padding: 0 11px 10px; color: var(--muted); font-size: .7rem; }
.is-selected .memory-prompt { color: var(--olive); font-weight: 700; }
.capture-label { display: block; margin: 0; padding: 0 11px 13px; color: var(--muted); font-size: .69rem; line-height: 1.5; }
.capture-field { border-top: 1px solid var(--line); padding: 10px; }
.capture-field label { display: block; margin-bottom: 7px; color: var(--olive-dark); font-size: .73rem; font-weight: 600; line-height: 1.5; }
.capture-field p { margin: 7px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.5; }
.capture-input { display: block; min-width: 0; width: 100%; max-width: 100%; min-height: 44px; padding: 5px; border: 1px solid #d5dacb; border-radius: 8px; color: var(--ink); background: var(--paper); font: inherit; font-size: 16px; }
.capture-input::-webkit-datetime-edit { padding: 0; }
.consent-note { margin: 20px 0 16px; padding: 15px; border: 1px solid #dde2d3; border-radius: 12px; color: #626a54; background: #f0f2eb; font-size: .77rem; line-height: 1.65; }
.instagram-invite { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; margin: 0 0 25px; padding: 17px; border: 1px solid #eccadc; border-radius: 15px; background: linear-gradient(130deg, #fff7fa, #fcf7ff); }
.instagram-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: radial-gradient(circle at 25% 105%, #ffdc80 0%, #fcaf45 16%, #f77737 30%, #fd1d1d 40%, #e1306c 55%, #c13584 70%, #833ab4 88%, #405de6 100%); }
.instagram-icon img { display: block; width: 25px; height: 25px; }
.instagram-icon-small { width: 26px; height: 26px; border-radius: 7px; }
.instagram-icon-small img { width: 16px; height: 16px; }
.next-step-note { color: #90246b; }
.instagram-invite h2 { margin: 0 0 8px; font-size: 1.18rem; }
.instagram-invite h2 { color: #90246b; }
.instagram-invite p { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.65; }
.instagram-link { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 50px; padding: 12px; border: 0; border-radius: 10px; color: white; background: var(--instagram-gradient); font-size: .81rem; font-weight: 700; text-decoration: none; }
.instagram-link-label { display: inline-flex; align-items: center; gap: 8px; }
.instagram-link .instagram-link-label { font-size: .81rem; font-weight: 700; }
.instagram-link-label img { flex-shrink: 0; }
.button-instagram { color: white; background: var(--instagram-gradient); }
.button-instagram img { margin-right: 6px; vertical-align: -4px; }
.button-instagram:hover, .instagram-link:hover { filter: brightness(.94); }
.button-instagram::before { content: ''; display: inline-block; width: 19px; height: 19px; margin-right: 8px; vertical-align: -3px; background: url('instagram-glyph.svg') center / contain no-repeat; }
#review-button::before { content: none; }
.consent-note { border-color: #eccadc; color: #7b3a64; background: #fff6fb; }
.consent-choice { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-weight: 500; line-height: 1.5; }
.consent-choice input { flex: none; margin-top: 4px; width: 18px; height: 18px; accent-color: #90246b; }
.instagram-link span { font-size: .76rem; font-weight: 500; }
.success-area p { line-height: 1.7; }
.success-area .button + .button { margin-top: 10px; }
.upload-guidance { margin: 18px 0 0; padding: 13px; border-radius: 10px; color: #596348; background: var(--sage); font-size: .79rem; line-height: 1.65; }
.upload-feedback { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 12px; margin-top: 17px; padding: 17px; border: 1px solid #ccd6bd; border-radius: 14px; background: #f0f3e9; }
.upload-feedback strong { display: block; font-size: .92rem; line-height: 1.5; color: var(--olive-dark); }
.upload-feedback p { margin: 7px 0 0; font-size: .8rem; color: #626a54; line-height: 1.6; }
.upload-feedback .upload-feedback-detail { font-size: .74rem; overflow-wrap: anywhere; }
.upload-animation { display: grid; position: relative; place-items: center; width: 39px; height: 39px; color: var(--olive); font-size: 1.6rem; }
.upload-feedback.is-running .upload-animation::before { position: absolute; inset: 0; border: 2px solid #d6dfca; border-top-color: var(--olive); border-radius: 50%; content: ''; animation: upload-spin 1.1s linear infinite; }
.upload-feedback.is-running .upload-animation span { animation: upload-heart 1.6s ease-in-out infinite; }
.upload-feedback.is-safe { border-color: #b7c69e; background: #eaf0e0; }
.safe-to-close { margin: 14px 0 20px !important; padding: 12px; border-radius: 10px; color: var(--olive-dark) !important; background: var(--sage); font-size: .8rem !important; line-height: 1.6 !important; }
.instagram-transition { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(34 38 27 / 48%); backdrop-filter: blur(3px); animation: transition-fade-in .25s ease-out; }
.instagram-transition-card { display: grid; justify-items: center; gap: 13px; width: min(100%, 390px); padding: 28px 24px; border: 1px solid #e4e6d9; border-radius: 20px; color: var(--olive-dark); background: var(--paper, #fffdf8); box-shadow: 0 16px 48px rgb(0 0 0 / 16%); text-align: center; animation: transition-card-in .45s ease-out; }
.instagram-transition-card strong { font-family: var(--font-display, Georgia, serif); font-size: 1.25rem; }
.instagram-transition-card p { margin: 0; color: #626a54; font-size: .87rem; line-height: 1.65; }
.instagram-transition .upload-animation { width: 48px; height: 48px; color: #9a286d; font-size: 2rem; }
.instagram-transition .upload-animation::before { position: absolute; inset: 0; border: 2px solid #f0d5e4; border-top-color: #cf2b84; border-radius: 50%; content: ''; animation: upload-spin 1s linear infinite; }
.instagram-transition .upload-animation span { animation: upload-heart 1.35s ease-in-out infinite; }
@keyframes transition-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes transition-card-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes upload-spin { to { transform: rotate(360deg); } }
@keyframes upload-heart { 50% { transform: scale(1.17); } }
@media (prefers-reduced-motion: reduce) { .upload-animation::before, .upload-animation span, .instagram-transition, .instagram-transition-card { animation: none !important; } }
@media (max-width: 360px) {
  .card-content { padding-left: 14px; padding-right: 14px; }
  .step-tab { font-size: .7rem; padding: 6px; }
  .step-number { width: 20px; height: 20px; }
  .media-gallery { gap: 9px; }
  .instagram-link { flex-direction: column; align-items: flex-start; }
}
