:root {
    --cream: #f4efe4;
    --cream-dark: #ebe3d4;
    --gold: #c5a04d;
    --gold-light: #d4af37;
    --gold-dark: #9a7b32;
    --text: #2c2416;
    --text-muted: #5c5345;
    --white: #fffdf8;
    --shadow: rgba(44, 36, 22, 0.12);
    --success: #3d6b4f;
    --error: #9b3b3b;
    --frame: 1px solid rgba(197, 160, 77, 0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Cormorant Garamond", Georgia, serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 38%),
        linear-gradient(180deg, #f7f2ea 0%, var(--cream) 45%, #efe7da 100%);
}

.guest-body {
    position: relative;
    overflow-x: hidden;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
}

.floral-border {
    position: fixed;
    top: 0;
    bottom: 0;
    width: clamp(72px, 12vw, 120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.92;
    background-repeat: repeat-y;
    background-size: 100% auto;
}

.floral-left {
    left: 0;
    background-image: url("../images/floral-left.svg");
}

.floral-right {
    right: 0;
    background-image: url("../images/floral-right.svg");
}

.invitation-card,
.page-card {
    position: relative;
    background: rgba(255, 253, 248, 0.92);
    border: var(--frame);
    box-shadow: 0 18px 50px var(--shadow);
    padding: clamp(1.5rem, 4vw, 2.75rem);
}

.invitation-card::before,
.page-card::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(197, 160, 77, 0.28);
    pointer-events: none;
}

.arabic-top {
    text-align: center;
    margin-bottom: 1.25rem;
}

.bismillah {
    font-family: "Noto Naskh Arabic", serif;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    color: var(--gold-dark);
    line-height: 1.8;
    margin: 0 0 0.35rem;
}

.blessing {
    font-family: "Noto Naskh Arabic", serif;
    font-size: clamp(0.95rem, 2.8vw, 1.15rem);
    color: var(--gold);
    line-height: 1.9;
    margin: 0;
}

.eyebrow {
    text-align: center;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    font-size: 0.82rem;
    margin: 0 0 0.75rem;
}

.couple-script {
    font-family: "Great Vibes", cursive;
    font-size: clamp(2.8rem, 10vw, 4.4rem);
    line-height: 1.1;
    text-align: center;
    margin: 0.25rem 0 0.5rem;
    color: var(--text);
}

.couple-full {
    text-align: center;
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--gold);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(197, 160, 77, 0.65), transparent);
}

.heart {
    font-size: 0.85rem;
}

.event-details {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.detail-row {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.detail-icon {
    width: 1.35rem;
    flex-shrink: 0;
    color: var(--gold);
    margin-top: 0.15rem;
}

.detail-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.15rem;
}

.detail-value {
    font-size: 1.15rem;
    line-height: 1.45;
}

.welcome-message {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 1.5rem 0 0;
}

.upload-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(197, 160, 77, 0.25);
}

.upload-section h2 {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--gold-dark);
    margin: 0 0 0.35rem;
}

.upload-section p {
    text-align: center;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    border: 1px solid rgba(197, 160, 77, 0.45);
    background: var(--white);
    padding: 0.8rem 0.95rem;
    font: inherit;
    color: var(--text);
}

input[type="file"] {
    padding: 0.65rem;
}

input:focus {
    outline: 2px solid rgba(197, 160, 77, 0.35);
    outline-offset: 1px;
}

.dropzone {
    border: 2px dashed rgba(197, 160, 77, 0.55);
    background: rgba(255, 255, 255, 0.65);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.dragover {
    border-color: var(--gold);
    background: rgba(197, 160, 77, 0.08);
}

.dropzone strong {
    display: block;
    font-size: 1.1rem;
    color: var(--gold-dark);
    margin-bottom: 0.35rem;
}

.dropzone span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid rgba(197, 160, 77, 0.35);
    background: #fff;
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-badge {
    position: absolute;
    left: 0.35rem;
    bottom: 0.35rem;
    background: rgba(44, 36, 22, 0.75);
    color: #fffdf8;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.4rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    padding: 0.85rem 1.25rem;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
    color: #fffdf8;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.92rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold-dark);
}

.alert {
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(61, 107, 79, 0.1);
    border-color: rgba(61, 107, 79, 0.25);
    color: var(--success);
}

.alert-error {
    background: rgba(155, 59, 59, 0.08);
    border-color: rgba(155, 59, 59, 0.25);
    color: var(--error);
}

.alert-info {
    background: rgba(197, 160, 77, 0.1);
    border-color: rgba(197, 160, 77, 0.25);
    color: var(--gold-dark);
}

.hidden {
    display: none !important;
}

.success-panel {
    text-align: center;
    padding: 1rem 0;
}

.success-panel h2 {
    color: var(--gold-dark);
    margin-bottom: 0.5rem;
}

.progress-wrap {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background: rgba(197, 160, 77, 0.2);
    overflow: hidden;
}

.progress-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.2s ease;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Admin */
.admin-body .page-shell {
    width: min(1100px, calc(100% - 2rem));
}

.admin-body .floral-border {
    opacity: 0.45;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--gold-dark);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.75);
    border: var(--frame);
    padding: 1rem;
}

.stat-card strong {
    display: block;
    font-size: 1.6rem;
    color: var(--gold-dark);
}

.stat-card span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.gallery-card {
    background: #fff;
    border: 1px solid rgba(197, 160, 77, 0.3);
    overflow: hidden;
}

.gallery-card img,
.gallery-card video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--cream-dark);
}

.gallery-video {
    background: #1a1610;
}

.gallery-meta {
    padding: 0.75rem;
    font-size: 0.92rem;
}

.gallery-meta strong {
    display: block;
    margin-bottom: 0.2rem;
}

.gallery-meta span {
    color: var(--text-muted);
}

.gallery-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.75rem 0.75rem;
}

.gallery-actions form {
    margin: 0;
}

.btn-small {
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
}

.install-card h1 {
    text-align: center;
    color: var(--gold-dark);
    margin-top: 0;
}

fieldset {
    border: 1px solid rgba(197, 160, 77, 0.3);
    padding: 1rem;
}

legend {
    padding: 0 0.35rem;
    color: var(--gold-dark);
}

@media (max-width: 720px) {
    .floral-border {
        width: 48px;
        opacity: 0.55;
    }

    .page-shell {
        width: calc(100% - 1rem);
        padding-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .floral-border {
        display: none;
    }
}
