:root {
    --bg: #f5eee6;
    --card: rgba(255, 251, 246, 0.82);
    --primary: #b56d52;
    --primary-dark: #92533d;
    --olive: #7e8b61;
    --olive-dark: #66704f;
    --text: #4f3d34;
    --muted: #8b786d;
    --border: rgba(146, 83, 61, 0.18);
    --shadow: 0 18px 50px rgba(90, 60, 47, 0.12);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

.site-entered #app-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(181, 109, 82, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(126, 139, 97, 0.12), transparent 25%),
        var(--bg);
    font-family: 'Inter', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.page-shell {
    position: relative;
    z-index: 2;
}

.toast-wrap {
    z-index: 1080;
}

.toast-wrap .toast {
    min-width: min(420px, calc(100vw - 24px));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.audio-dock {
    position: relative;
    z-index: 3;
    width: min(960px, calc(100vw - 24px));
    margin: 0 auto 28px;
    padding: 12px 16px;
    border-radius: 24px;
}

.audio-dock-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.audio-dock-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(181, 109, 82, 0.12);
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.audio-dock-text {
    flex: 1 1 auto;
    min-width: 0;
}

.audio-dock-text strong {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    line-height: 1.1;
}

.audio-dock-text span {
    display: block;
    color: var(--muted);
    font-size: 0.95rem;
}

.audio-dock-button {
    white-space: nowrap;
    min-width: 120px;
}

.guest-shell,
.admin-shell {
    padding: 28px 14px;
}

.guest-container {
    max-width: 960px;
    margin: 0 auto;
}

.glass-card,
.invite-card,
.admin-panel,
.stat-card,
.data-card,
.auth-card {
    background: var(--card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.invite-card,
.auth-card,
.data-card,
.stat-card {
    position: relative;
    overflow: hidden;
}

.invite-card::before,
.auth-card::before,
.data-card::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(126, 139, 97, 0.16);
    border-radius: calc(var(--radius-xl) - 8px);
    pointer-events: none;
}

.hero-card {
    padding: 44px 24px;
}

.brand-script {
    display: block;
    color: var(--primary-dark);
    font-family: 'Great Vibes', cursive;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1;
}

.brand-subtitle,
.section-subtitle {
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.section-title,
.card-title,
.metric-value,
.admin-title {
    font-family: 'Cormorant Garamond', serif;
    color: var(--text);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 0.75rem;
}

.hero-description {
    max-width: 720px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.8;
}

.photo-showcase {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    min-height: 280px;
}

.showcase-photo {
    position: relative;
    width: min(280px, 42vw);
    padding: 10px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(181, 109, 82, 0.18);
    box-shadow: 0 18px 40px rgba(90, 60, 47, 0.16);
}

.showcase-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 22px;
    display: block;
}

.showcase-photo-main {
    transform: rotate(-5deg);
    z-index: 2;
}

.showcase-photo-secondary {
    margin-left: -48px;
    transform: translateY(28px) rotate(6deg);
}

.wedding-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 2rem;
}

.detail-pill {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(181, 109, 82, 0.12);
    background: rgba(255, 255, 255, 0.54);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-pill i {
    color: var(--primary);
    margin-right: 8px;
}

.btn-theme,
.btn-olive {
    border: none;
    border-radius: 999px;
    padding: 0.92rem 1.4rem;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn-theme {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 30px rgba(181, 109, 82, 0.28);
}

.btn-olive {
    color: #fff;
    background: linear-gradient(135deg, var(--olive), var(--olive-dark));
    box-shadow: 0 14px 30px rgba(126, 139, 97, 0.28);
}

.btn-theme:hover,
.btn-olive:hover,
.btn-outline-theme:hover {
    transform: translateY(-2px);
}

.btn-outline-theme {
    border-radius: 999px;
    border: 1px solid rgba(181, 109, 82, 0.35);
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.55);
}

.form-control,
.form-select {
    border-radius: 16px;
    min-height: 52px;
    border: 1px solid rgba(126, 139, 97, 0.2);
    background-color: rgba(255, 255, 255, 0.82);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(181, 109, 82, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(181, 109, 82, 0.12);
}

.form-label,
.form-check-label {
    font-weight: 500;
}

.radio-card {
    border: 1px solid rgba(181, 109, 82, 0.18);
    border-radius: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.56);
}

.guest-block {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(126, 139, 97, 0.18);
    background: rgba(255, 255, 255, 0.48);
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 999px;
    background: rgba(126, 139, 97, 0.12);
    color: var(--olive-dark);
    font-weight: 600;
}

.heart-icon {
    width: 94px;
    height: 94px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(181, 109, 82, 0.12), rgba(126, 139, 97, 0.12));
    color: var(--primary);
    font-size: 2.2rem;
    box-shadow: inset 0 0 0 1px rgba(181, 109, 82, 0.16);
}

.floral-corner {
    position: fixed;
    width: 220px;
    height: 220px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.45;
}

.floral-corner::before,
.floral-corner::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    filter: blur(1px);
}

.floral-corner::before {
    width: 88px;
    height: 88px;
    background: radial-gradient(circle, rgba(181, 109, 82, 0.78) 0%, rgba(181, 109, 82, 0.15) 68%, transparent 72%);
}

.floral-corner::after {
    width: 120px;
    height: 50px;
    background: radial-gradient(circle, rgba(126, 139, 97, 0.88) 0%, rgba(126, 139, 97, 0.12) 65%, transparent 72%);
    transform: rotate(35deg);
}

.floral-top-left {
    top: 0;
    left: 0;
}

.floral-top-left::before {
    top: 34px;
    left: 36px;
}

.floral-top-left::after {
    top: 96px;
    left: 82px;
}

.floral-top-right {
    top: 0;
    right: 0;
    transform: scaleX(-1);
}

.floral-bottom-left {
    bottom: 0;
    left: 0;
    transform: scaleY(-1);
}

.floral-bottom-right {
    right: 0;
    bottom: 0;
    transform: scale(-1);
}

.app-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(245, 238, 230, 0.88);
    backdrop-filter: blur(12px);
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    text-align: center;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.loader-photo-frame {
    width: 130px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(181, 109, 82, 0.22);
    box-shadow: 0 16px 34px rgba(90, 60, 47, 0.15);
}

.loader-photo-frame img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 18px;
    display: block;
}

.loader-photo-left {
    transform: rotate(-6deg);
}

.loader-photo-right {
    margin-left: -20px;
    transform: translateY(12px) rotate(5deg);
}

.loader-heart {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(181, 109, 82, 0.16), rgba(126, 139, 97, 0.16));
    color: var(--primary);
    font-size: 1.8rem;
    animation: pulseHeart 1.2s infinite ease-in-out;
}

.loader-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    color: var(--primary-dark);
    letter-spacing: 0.04em;
}

.loader-subtitle {
    color: var(--muted);
    font-size: 1rem;
    max-width: 340px;
}

.loader-enter-button {
    min-width: 180px;
    margin-top: 4px;
}

.loader-enter-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes pulseHeart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.auth-wrapper {
    max-width: 520px;
    margin: 0 auto;
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
}

.admin-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--text);
    font-weight: 500;
}

.admin-nav .nav-link.active,
.admin-nav .nav-link:hover {
    background: rgba(181, 109, 82, 0.11);
    color: var(--primary-dark);
}

.admin-main {
    min-width: 0;
}

.admin-header {
    padding: 28px;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 22px;
}

.metric-value {
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1;
}

.metric-label {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
}

.data-card {
    padding: 24px;
}

.table thead th {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table tbody td {
    vertical-align: middle;
}

.badge-soft {
    padding: 0.58rem 0.88rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-success-soft {
    color: #2d5b39;
    background: rgba(79, 153, 98, 0.16);
}

.badge-danger-soft {
    color: #7b4738;
    background: rgba(181, 109, 82, 0.18);
}

.badge-warning-soft {
    color: #7b6b39;
    background: rgba(197, 172, 96, 0.22);
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar .form-control,
.toolbar .form-select {
    min-width: 180px;
}

.token-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.photo-frame {
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(126, 139, 97, 0.18);
}

.photo-frame img {
    border-radius: 18px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-state {
    padding: 42px 24px;
    text-align: center;
    color: var(--muted);
}

.print-only {
    display: none;
}

@media print {
    body {
        background: #fff;
    }

    .admin-sidebar,
    .toolbar,
    .btn,
    .floral-corner,
    .toast-wrap,
    .app-loader {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .data-card,
    .stat-card,
    .admin-header {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

@media (max-width: 991.98px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        height: auto;
        top: 0;
    }

    .brand-script {
        font-size: clamp(2rem, 8vw, 3.8rem);
    }
}

@media (max-width: 767.98px) {
    .audio-dock {
        margin-bottom: 18px;
        padding: 12px;
    }

    .audio-dock-content {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .audio-dock-button {
        width: 100%;
    }

    .photo-showcase {
        min-height: auto;
        flex-direction: column;
        gap: 16px;
    }

    .showcase-photo {
        width: min(100%, 280px);
    }

    .showcase-photo-main,
    .showcase-photo-secondary {
        transform: none;
        margin-left: 0;
    }

    .loader-photo-frame {
        width: 108px;
    }

    .toast-wrap {
        left: 12px;
        right: 12px;
        top: 12px;
        padding: 0 !important;
    }

    .toast-wrap .toast {
        min-width: 100%;
    }

    .hero-card,
    .data-card,
    .admin-header {
        padding: 24px 18px;
    }

    .guest-block {
        padding: 18px;
    }

    .floral-corner {
        width: 150px;
        height: 150px;
        opacity: 0.3;
    }
}
