* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    background: #2a1f1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overscroll-behavior-y: contain;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

.video-section {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    overflow: hidden;
}

.video-stage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    height: 100%;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    max-height: 100%;
}

@media (orientation: portrait) {
    .video-stage {
        height: auto;
        width: 100%;
    }
}

.intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
}

.pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 6;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pause-indicator.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.pause-indicator svg {
    width: 36px;
    height: 36px;
    margin-left: 4px;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    transition: opacity 0.4s ease;
    z-index: 5;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

.video-overlay:active .play-icon {
    transform: scale(0.94);
}

.play-icon svg {
    width: 40px;
    height: 40px;
    margin-left: 4px;
}

.play-label {
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

.skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skip-btn.visible {
    opacity: 0.85;
}

.skip-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.video-progress {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 8;
    pointer-events: none;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.video-progress-fill {
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 4px;
    transition: width 0.15s linear;
}

.invitation-section {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a1f1a;
    padding: 0;
}

.invitation-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    background: #2a1f1a;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

.pages-wrapper {
    display: flex;
    width: 400%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.pages-wrapper.dragging {
    transition: none;
}

.page {
    width: 25%;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-stage {
    position: relative;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
}

@supports not (aspect-ratio: 1) {
    .page-stage {
        height: 100%;
        width: calc(100% * (9 / 16));
    }
}

.page-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    display: block;
    transform: scale(1.005);
}

.page[data-page="1"] .page-image {
    transform: scale(1.02);
}

.hotspot {
    position: absolute;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    text-decoration: none;
    display: block;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.hotspot:active {
    background: rgba(255, 255, 255, 0.25);
}

body.debug .hotspot {
    background: rgba(255, 80, 80, 0.35);
    border: 2px dashed rgba(255, 0, 0, 0.8);
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease, background 0.2s ease;
    opacity: 0.6;
}

.nav-arrow:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.45);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.92);
}

.nav-arrow svg {
    width: 20px;
    height: 20px;
}

.nav-arrow-prev {
    left: 10px;
}

.nav-arrow-next {
    right: 10px;
}

.nav-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-indicators {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, width 0.3s ease;
}

.indicator.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

.debug-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    opacity: 0.4;
}

.debug-toggle:hover {
    opacity: 1;
}

body.debug .debug-toggle {
    background: rgba(255, 0, 0, 0.6);
    color: #fff;
    opacity: 1;
}

@media (hover: none) and (pointer: coarse) {
    .nav-arrow {
        opacity: 0.45;
    }
}

@media (min-width: 501px) {
    .invitation-section {
        padding: 20px;
    }

    .invitation-container {
        height: min(900px, calc(100vh - 40px));
        aspect-ratio: 9 / 16;
        width: auto;
        max-width: 100%;
        border-radius: 24px;
    }
}

.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(20, 14, 10, 0.92);
    color: #fff;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    max-width: 80vw;
}

.copy-toast.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.copy-toast svg {
    width: 20px;
    height: 20px;
    color: #6acc6a;
    flex-shrink: 0;
}

.audio-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
    opacity: 0.85;
    padding: 0;
}

.audio-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.65);
}

.audio-toggle:active {
    transform: scale(0.92);
}

.audio-toggle[hidden] {
    display: none;
}

.audio-toggle svg {
    width: 20px;
    height: 20px;
}

.audio-toggle .icon-mute { display: none; }
.audio-toggle.muted .icon-volume { display: none; }
.audio-toggle.muted .icon-mute { display: block; }

.rsvp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 14, 10, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: stretch;
    justify-content: center;
    overflow-y: auto;
    padding: 0;
}

.rsvp-overlay.visible {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rsvp-modal {
    width: 100%;
    max-width: 500px;
    background: #faf5ef;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

.rsvp-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #faf5ef;
    position: sticky;
    top: 0;
    z-index: 5;
}

.rsvp-title {
    flex: 1;
}

.rsvp-title h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: normal;
    color: #3d2817;
    margin-bottom: 4px;
}

.rsvp-title p {
    font-size: 13px;
    color: #806550;
    line-height: 1.4;
}

.rsvp-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: #3d2817;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.rsvp-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.rsvp-close svg {
    width: 18px;
    height: 18px;
}

.rsvp-step {
    padding: 24px 20px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rsvp-step[hidden] {
    display: none;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.search-label {
    font-size: 13px;
    color: #806550;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: -4px;
}

.search-form input {
    padding: 14px 18px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    background: #fff;
    font-size: 17px;
    color: #3d2817;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input:focus {
    border-color: #8b6f47;
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.15);
}

.primary-btn {
    padding: 14px 24px;
    background: #3d2817;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover { background: #2a1c10; }
.primary-btn:active { transform: scale(0.98); }

.search-error {
    margin-top: 14px;
    padding: 16px 14px;
    background: #fce8e8;
    color: #a13030;
    font-size: 14px;
    border-radius: 10px;
    text-align: center;
}

.search-error p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.whatsapp-link:hover {
    background: #1faa52;
}

.whatsapp-link svg {
    width: 18px;
    height: 18px;
}

.step-intro {
    font-size: 15px;
    color: #3d2817;
    line-height: 1.5;
    margin-bottom: 18px;
}

.family-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.family-option {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.2s;
}

.family-option:hover {
    border-color: #8b6f47;
    background: #fefaf5;
}

.family-option strong {
    color: #3d2817;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    line-height: 1.45;
    word-break: break-word;
}

.family-option small {
    color: #a08870;
    font-size: 12px;
    background: rgba(139, 111, 71, 0.1);
    padding: 4px 10px;
    border-radius: 10px;
    flex-shrink: 0;
    align-self: flex-start;
}

.link-btn {
    background: none;
    border: none;
    color: #806550;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 4px;
    align-self: flex-start;
}

.link-btn:hover {
    color: #3d2817;
    text-decoration: underline;
}

.confirm-note {
    font-size: 13px;
    color: #7a4a2e;
    line-height: 1.5;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: rgba(176, 122, 58, 0.12);
    border-left: 3px solid #b07a3a;
    border-radius: 8px;
}

.confirm-note .note-icon {
    width: 14px;
    height: 14px;
    vertical-align: -3px;
    margin-right: 6px;
    display: inline-block;
    color: #b07a3a;
}

.edit-hint {
    font-size: 13px;
    color: #6e5640;
    line-height: 1.6;
    margin-bottom: 14px;
    padding: 11px 14px;
    background: rgba(139, 111, 71, 0.09);
    border-left: 3px solid #b59474;
    border-radius: 8px;
}

.edit-hint .hint-icon {
    width: 14px;
    height: 14px;
    vertical-align: -3px;
    margin: 0 2px;
    display: inline-block;
}

.member-list {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 4px 16px;
    margin-bottom: 16px;
}

.member-row {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    gap: 12px;
    user-select: none;
}

.member-row + .member-row {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.member-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #8b6f47;
    flex-shrink: 0;
    cursor: pointer;
}

.member-row .member-name {
    flex: 1;
    font-size: 15px;
    color: #3d2817;
    cursor: pointer;
    word-break: break-word;
}

.member-row .member-name.placeholder {
    color: #806550;
    font-style: italic;
}

.edit-name-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #a08870;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.edit-name-btn:hover {
    background: rgba(139, 111, 71, 0.12);
    color: #3d2817;
}

.edit-name-btn svg {
    width: 16px;
    height: 16px;
}

.edit-name-btn.is-pill {
    padding: 0;
    border-radius: 14px;
}

.nomear-pill {
    display: inline-block;
    padding: 5px 12px;
    background: #8b6f47;
    color: #fff;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s;
}

.edit-name-btn.is-pill:hover {
    background: transparent;
}

.edit-name-btn.is-pill:hover .nomear-pill {
    background: #3d2817;
}

.hint-pill {
    display: inline-block;
    padding: 1px 8px;
    background: #8b6f47;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
    margin: 0 2px;
}

.edit-hint em {
    font-style: italic;
    color: #6e5640;
    font-weight: 500;
}

.member-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #8b6f47;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    color: #3d2817;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.15);
    min-width: 0;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons button {
    flex: 1;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    color: #3d2817;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm {
    background: #3d2817;
    color: #fff;
    border-color: #3d2817;
    font-weight: 500;
}

.btn-confirm:disabled {
    background: #c9bfb4;
    border-color: #c9bfb4;
    cursor: not-allowed;
}

.btn-confirm:not(:disabled):hover {
    background: #2a1c10;
}

.btn-confirm.sending {
    background: #806550;
    cursor: wait;
}

.btn-decline {
    color: #806550;
}

.btn-decline:hover {
    background: rgba(0, 0, 0, 0.04);
}

.rsvp-success {
    position: absolute;
    inset: 0;
    background: #faf5ef;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    z-index: 10;
}

.rsvp-success[hidden] {
    display: none;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #4a7c4a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon svg {
    width: 36px;
    height: 36px;
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.rsvp-success h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    color: #3d2817;
    font-weight: normal;
    margin-bottom: 10px;
}

.rsvp-success p {
    color: #806550;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 28px;
    max-width: 320px;
}

.success-btn {
    padding: 14px 28px;
    background: #3d2817;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
}

.success-btn:hover {
    background: #2a1c10;
}

.group-actions .btn-confirm.sending {
    background: #806550;
    cursor: wait;
}

.send-error {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fce8e8;
    color: #a13030;
    font-size: 13px;
    border-radius: 8px;
    text-align: center;
}
