:root {
  color-scheme: light;
  --ink: #f9f8ff;
  --muted: rgba(255, 255, 255, .72);
  --glass: rgba(27, 53, 103, .50);
  --glass-strong: rgba(31, 50, 95, .74);
  --stroke: rgba(255, 255, 255, .16);
  --pink: #f6c9e6;
  --lavender: #d8d6ff;
  --blue: #a9d9ff;
  --shadow: 0 22px 65px rgba(15, 25, 70, .28);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #14274b; }
body { margin: 0; min-height: 100vh; color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(255,255,255,.64); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 5px; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.62); }

/* Page Stelly */
.sender-page { position: relative; overflow-x: hidden; background: #355da6; }
.video-background { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; filter: blur(4px); transform: scale(1.025); pointer-events: none; }
.ambient-overlay { position: fixed; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(21,39,77,.18), rgba(28,35,75,.45) 55%, rgba(71,33,86,.56)); backdrop-filter: saturate(1.08); pointer-events: none; }
.phone-shell { position: relative; z-index: 2; width: min(100%, 500px); min-height: 100svh; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 24px) 18px calc(env(safe-area-inset-bottom) + 30px); }
.sender-header, .dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 2px 24px; }
.sender-header h1, .dashboard-header h1 { max-width: 340px; margin: 0; font-size: clamp(1.75rem, 8vw, 2.35rem); line-height: 1.04; letter-spacing: -.04em; }
.header-heart { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--stroke); border-radius: 17px; font-size: 1.35rem; background: rgba(255,255,255,.12); box-shadow: inset 0 1px rgba(255,255,255,.2); backdrop-filter: blur(18px); }
.view { display: none; animation: view-in .34s cubic-bezier(.2,.8,.2,1); }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.card-list, .choice-list { display: grid; gap: 12px; }
.category-card, .choice-card { width: 100%; display: flex; align-items: center; gap: 14px; border: 1px solid var(--stroke); color: white; text-align: left; background: linear-gradient(135deg, rgba(51,93,151,.62), rgba(86,58,123,.54)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.14); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); cursor: pointer; }
.category-card { min-height: 86px; padding: 17px; border-radius: 24px; }
.choice-card { min-height: 82px; padding: 16px; border-radius: 22px; }
.category-card:active, .choice-card:active { transform: scale(.985); }
.card-emoji, .choice-emoji { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 17px; font-size: 1.35rem; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.12); }
.card-copy, .choice-copy { min-width: 0; flex: 1; }
.card-copy strong, .choice-copy strong { display: block; font-size: 1rem; letter-spacing: -.01em; }
.card-copy span, .choice-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.card-arrow { color: rgba(255,255,255,.54); font-size: 1.25rem; }
.back-button { margin: 0 0 18px; padding: 9px 12px; border: 1px solid var(--stroke); border-radius: 999px; color: white; background: rgba(24,46,89,.44); backdrop-filter: blur(15px); cursor: pointer; }
.section-intro { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-intro h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.section-emoji { font-size: 2rem; }
.compose-card { padding: 22px; border: 1px solid var(--stroke); border-radius: 28px; background: linear-gradient(150deg, rgba(34,67,122,.74), rgba(105,63,122,.68)); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.compose-card h2 { margin: 14px 0 20px; font-size: 1.55rem; }
.compose-card label { display: block; margin-bottom: 8px; font-size: .86rem; font-weight: 750; }
.selected-pill { display: inline-flex; padding: 8px 11px; border: 1px solid var(--stroke); border-radius: 999px; color: rgba(255,255,255,.85); background: rgba(255,255,255,.10); font-size: .78rem; }
textarea, .login-card input { width: 100%; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; color: white; background: rgba(9,26,61,.38); }
textarea { resize: vertical; min-height: 138px; padding: 15px; line-height: 1.45; }
textarea::placeholder, .login-card input::placeholder { color: rgba(255,255,255,.48); }
.character-count { margin: 6px 4px 16px; text-align: right; color: var(--muted); font-size: .76rem; }
.primary-button, .secondary-button, .light-button, .ghost-button { border: 0; border-radius: 16px; font-weight: 800; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.primary-button { width: 100%; min-height: 52px; padding: 12px 17px; color: #2b3158; background: linear-gradient(135deg, #fff, #ecdfff); box-shadow: 0 10px 28px rgba(19,24,68,.24); }
.primary-button:active, .secondary-button:active, .light-button:active, .ghost-button:active { transform: scale(.98); }
.primary-button:disabled, .light-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { padding: 10px 13px; color: white; background: rgba(255,255,255,.12); border: 1px solid var(--stroke); }
.privacy-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 21px; font-size: 1.7rem; background: rgba(255,255,255,.12); }
.privacy-copy { color: rgba(255,255,255,.9); line-height: 1.55; }
.privacy-points { margin: 14px 0 22px; padding-left: 20px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.privacy-points li + li { margin-top: 8px; }
.photo-preview-wrap { margin-top: 18px; }
.photo-preview-wrap img { display: block; width: 100%; max-height: 52svh; object-fit: cover; border-radius: 20px; border: 1px solid var(--stroke); }
.photo-actions { display: flex; justify-content: flex-end; margin: 10px 0 16px; }
.consent-fieldset { display: grid; gap: 9px; margin: 0 0 17px; padding: 14px; border: 1px solid var(--stroke); border-radius: 18px; }
.consent-fieldset legend { padding: 0 5px; font-weight: 800; font-size: .86rem; }
.consent-fieldset label { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.08); }

/* Modales et retours */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(10,18,45,.45); opacity: 0; pointer-events: none; transition: opacity .22s ease; backdrop-filter: blur(14px); }
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.modal-card, .sending-card { width: min(100%, 420px); border: 1px solid var(--stroke); border-radius: 29px; box-shadow: 0 30px 90px rgba(5,12,40,.35); }
.login-card { transition: transform .2s ease; }
.modal-backdrop.is-keyboard-open .login-card { transform: translateY(calc(-1 * var(--keyboard-shift, 0px))); }
.login-card { padding: 25px; color: white; background: linear-gradient(150deg, rgba(46,86,146,.94), rgba(96,57,124,.94)); }
.login-card h2 { margin: 5px 0 7px; font-size: 1.75rem; }
.login-card > p:not(.eyebrow):not(.form-error) { margin: 0 0 20px; color: var(--muted); line-height: 1.45; }
.login-card label { display: block; margin: 0 0 7px; font-size: .82rem; font-weight: 800; }
.login-card input { height: 52px; margin-bottom: 8px; padding: 0 15px; }
.login-card .primary-button { margin-top: 10px; }
.login-icon { display: grid; width: 55px; height: 55px; place-items: center; margin-bottom: 16px; border-radius: 20px; font-size: 1.55rem; background: rgba(255,255,255,.12); }
.pin-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pin-fieldset legend { margin: 0 0 7px; padding: 0; font-size: .82rem; font-weight: 800; }
.pin-inputs { display: flex; gap: 7px; }
.login-card .pin-input { min-width: 0; height: 54px; margin: 0; padding: 0; flex: 1; border-radius: 14px; text-align: center; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.login-card .pin-input:focus { outline: 2px solid rgba(255,255,255,.85); outline-offset: 2px; }
.pin-help { margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.form-error { min-height: 18px; margin: 4px 0 !important; color: #ffd8e6 !important; font-size: .8rem; }
.sending-card { padding: 31px 24px; text-align: center; background: linear-gradient(150deg, rgba(51,89,145,.96), rgba(111,65,126,.96)); }
.sending-card h2 { margin: 13px 0 6px; }
.sending-card p { margin: 0; color: var(--muted); }
.flying-message { font-size: 3rem; animation: message-fly 1.2s ease-in-out infinite; }
@keyframes message-fly { 0%,100% { transform: translateY(3px) rotate(-4deg) scale(.96); } 50% { transform: translateY(-8px) rotate(5deg) scale(1.06); } }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); width: max-content; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 999px; color: white; text-align: center; background: rgba(11,21,50,.88); box-shadow: 0 10px 35px rgba(0,0,0,.25); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* Web app Gus */
.receiver-page { min-height: 100svh; overflow-x: hidden; background: linear-gradient(155deg, #071226, #10274b 44%, #523e75 100%); }
.receiver-glow { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .48; pointer-events: none; }
.receiver-glow-one { width: 70vw; height: 70vw; right: -20vw; top: 4vh; background: #2c73cb; }
.receiver-glow-two { width: 80vw; height: 80vw; left: -30vw; bottom: -15vh; background: #aa5c9d; }
.dashboard-shell { position: relative; width: min(100%, 540px); min-height: 100svh; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 25px) 17px calc(env(safe-area-inset-bottom) + 35px); }
.dashboard-header h1 { font-size: clamp(1.8rem, 8vw, 2.45rem); }
.status-orb { width: 13px; height: 13px; margin-top: 12px; border-radius: 50%; background: #97ffc3; box-shadow: 0 0 0 7px rgba(151,255,195,.1), 0 0 24px rgba(151,255,195,.75); }
.notification-panel, .messages-panel { border: 1px solid rgba(255,255,255,.11); border-radius: 28px; background: linear-gradient(145deg, rgba(27,58,110,.62), rgba(57,46,103,.58)); box-shadow: 0 24px 70px rgba(0,7,25,.32), inset 0 1px rgba(255,255,255,.09); backdrop-filter: blur(28px); }
.notification-panel { margin-bottom: 16px; padding: 20px; }
.messages-panel { padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-heading h2 { margin: 0; font-size: 1.32rem; letter-spacing: -.025em; }
.status-badge { flex: 0 0 auto; padding: 7px 9px; border-radius: 999px; color: #dce9ff; background: rgba(123,166,255,.14); border: 1px solid rgba(160,194,255,.16); font-size: .69rem; font-weight: 800; }
.status-badge.is-ok { color: #bfffd7; background: rgba(80,204,132,.13); border-color: rgba(104,235,159,.18); }
.status-badge.is-warning { color: #ffe3a7; background: rgba(235,174,67,.12); border-color: rgba(255,207,120,.18); }
.status-copy, .panel-hint { color: rgba(235,241,255,.65); font-size: .82rem; line-height: 1.45; }
.status-copy { margin: 11px 0 16px; }
.panel-hint { margin: 7px 0 16px; }
.install-instructions { margin: 0 0 16px; padding: 14px; border-radius: 17px; color: rgba(246,248,255,.83); background: rgba(3,13,37,.28); font-size: .8rem; line-height: 1.45; }
.install-instructions ol { margin: 9px 0 0; padding-left: 21px; }
.install-instructions li + li { margin-top: 5px; }
.button-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }
.light-button, .ghost-button { min-height: 48px; padding: 11px 14px; }
.light-button { color: #192441; background: linear-gradient(135deg, #fff, #e7e4ff); }
.ghost-button { color: #eaf0ff; background: rgba(109,146,214,.18); border: 1px solid rgba(173,198,243,.13); }
.full-width { width: 100%; }
.message-count { display: grid; min-width: 32px; height: 32px; padding: 0 9px; place-items: center; border-radius: 12px; color: #dce8ff; background: rgba(129,160,224,.14); font-size: .78rem; font-weight: 900; }
.message-list { display: grid; gap: 10px; }
.message-card { position: relative; width: 100%; display: flex; align-items: center; gap: 13px; min-height: 72px; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 19px; color: white; text-align: left; background: rgba(28,50,96,.51); cursor: pointer; }
.message-card.unread { background: linear-gradient(135deg, rgba(43,81,146,.75), rgba(80,59,121,.65)); }
.message-card.unread::after { content: ''; position: absolute; top: 13px; right: 13px; width: 7px; height: 7px; border-radius: 50%; background: #ffc7e9; box-shadow: 0 0 13px #ef9bd0; }
.message-card .card-emoji { width: 43px; height: 43px; border-radius: 15px; }
.message-card strong { display: block; font-size: .94rem; }
.message-card time { display: block; margin-top: 4px; color: rgba(235,241,255,.55); font-size: .73rem; }
.empty-state { padding: 18px; border: 1px dashed rgba(255,255,255,.13); border-radius: 17px; color: rgba(235,241,255,.55); text-align: center; font-size: .82rem; }
.modal-backdrop.dark { background: rgba(1,6,20,.58); }
.dark-card { background: linear-gradient(145deg, rgba(20,44,87,.97), rgba(54,43,91,.97)); }
.message-modal-card { width: min(100%, 460px); max-height: min(88svh, 760px); overflow-y: auto; padding: 22px; border: 1px solid rgba(255,255,255,.11); border-radius: 29px; color: white; background: linear-gradient(150deg, rgba(9,22,48,.98), rgba(23,19,48,.98)); box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.message-modal-card header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.message-modal-card h2 { margin: 0; font-size: 1.4rem; }
.icon-button { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; color: white; background: rgba(255,255,255,.06); font-size: 1.5rem; cursor: pointer; }
.message-details { display: grid; gap: 9px; margin: 18px 0; }
.detail-row { padding: 12px 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: rgba(255,255,255,.035); }
.detail-row span { display: block; margin-bottom: 4px; color: rgba(235,241,255,.5); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.detail-row strong, .detail-row p { margin: 0; color: rgba(248,249,255,.9); font-size: .87rem; line-height: 1.45; }
.photo-zone { margin: 0 0 17px; }
.photo-zone img { display: block; width: 100%; max-height: 46svh; object-fit: contain; border-radius: 18px; background: #050a16; }
.photo-caption { margin: 9px 0 12px; color: rgba(235,241,255,.6); font-size: .76rem; line-height: 1.4; }
.timer { font-variant-numeric: tabular-nums; color: #ffc8e5; font-weight: 900; }
.dark-toast { background: rgba(3,9,24,.94); }

@media (min-width: 700px) {
  .sender-page::before, .receiver-page::before { content: ''; position: fixed; inset: 0; pointer-events: none; box-shadow: inset 0 0 180px rgba(3,9,30,.35); }
  .phone-shell, .dashboard-shell { border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .video-background { display: none; }
  .sender-page { background: linear-gradient(155deg, #4e86c8, #9b7fc5 55%, #b875ad); }
}
