:root {
    color-scheme: only light;
    /* Main colors */
    --primary-color: #8B2635;
    --primary-hover: #A73142;
    --accent-color: #C9485B;
    
    /* Text colors */
    --text-primary: #2d1519;
    --text-secondary: #8B6E70;
    
    /* Background colors */
    --bg-white: #FFF5EB;
    --bg-light: #FFEFD5;
    --bg-gray: #F5E6E8;
    
    /* Border colors */
    --border-light: #D4A5A5;
    
    /* Success colors */
    --success-color: #4A7C59;
    --success-bg: #E8F5E9;
    
    /* Error colors */
    --error-color: #C62828;
    --error-bg: #FFEBEE;
    
    /* Shadows and overlays */
    --shadow-light: rgba(139, 38, 53, 0.08);
    --overlay-transparent: rgba(255, 255, 255, 0);
    --overlay-semi: rgba(255, 248, 245, 0.85);
    --overlay-solid: rgba(255, 248, 245, 1);
    
    /* Floral pattern colors */
    --floral-bg-color: #d1cdc8;
    --floral-pattern-color: #a3918b;
    --gold-shadow-strong:
        0 0 12px rgba(255, 255, 255, 1),
        0 0 24px rgba(255, 255, 255, 1),
        0 0 42px rgba(255, 255, 255, 1),
        0 0 70px rgba(255, 255, 255, 1),
        0 0 110px rgba(255, 255, 255, 1);
    --gold-outline-strong: 1.6px rgba(255, 255, 255, 0.98);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #ffffff !important;
    color: #2d1519 !important;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #2d1519 !important;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-color: #ffffff !important;
    background-repeat: repeat-y !important;
    background-position: center top !important;
    background-size: 100% auto !important;
    background-attachment: scroll !important;
}

body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 250, 245, 0.28);
    pointer-events: none;
    z-index: 0;
}

body.ceremony-page {
    background-image: url('../trauungBackground.jpg') !important;
}

body.with-rsvp-page {
    background-image: url('../trauungBackground.jpg') !important;
}

/* Background */
.parallax-bg {
    display: none;
}

/* Fade in on scroll animation */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px 4px;
    position: relative;
    z-index: 1;
}

/* Language Selector */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px;
}

.lang-btn {
    background: white;
    border: 1px solid #C5A55A;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.lang-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow-light);
}

header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 0 20px 0;
}

h1 {
    font-family: 'Ballet', cursive;
    font-size: 3.6em;
    color: #d0aa55;
    margin-bottom: 5px;
    font-weight: 400;
    letter-spacing: 1px;
    -webkit-text-stroke: var(--gold-outline-strong);
    paint-order: stroke fill;
    text-shadow: var(--gold-shadow-strong);
}

h1.names-stacked {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1.1;
}

header h1.names-stacked {
    position: relative;
    padding: 18px 34px;
    z-index: 1;
}

header h1.names-stacked::before {
    content: '';
    position: absolute;
    inset: -10px -18px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    filter: blur(12px);
    z-index: -1;
}

.ampersand {
    color: #d0aa55;
    font-style: italic;
    font-size: 0.8em;
    -webkit-text-stroke: var(--gold-outline-strong);
    paint-order: stroke fill;
    text-shadow: var(--gold-shadow-strong);
}

.subtitle {
    font-family: 'Parisienne', cursive;
    font-size: 1.3em;
    color: #111111;
    letter-spacing: 0;
    margin-top: 15px;
}

.wedding-info p {
    margin: 4px 0;
    font-size: 0.98em;
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
}

.info-block {
    margin-bottom: 16px;
    text-align: center;
}

.wedding-info .info-heading,
.wedding-info p.info-heading {
    font-family: 'Ballet', cursive;
    font-weight: 400;
    font-size: 2.0em;
    text-transform: none;
    letter-spacing: 0;
    color: #b68f3b;
    margin-bottom: 10px;
    line-height: 1;
    -webkit-text-stroke: var(--gold-outline-strong);
    paint-order: stroke fill;
    text-shadow: var(--gold-shadow-strong);
}

.info-note {
    font-style: italic;
    font-size: 0.88em;
    color: var(--text-secondary);
    margin-top: 6px;
}

.info-divider {
    border: none;
    border-top: 1px solid #C5A55A;
    margin: 16px 40px;
    opacity: 0.5;
}

.maps-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88em;
    border-bottom: 1px dotted var(--text-secondary);
}

.maps-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.rsvp-deadline {
    margin-top: 16px;
    font-size: 0.85em;
    color: #93adc4;
    text-align: center;
}

.label-info {
    font-weight: 600;
    color: var(--text-primary);
}

.with-flowers {
    padding: 3px;
    border: 1px solid #C5A55A;
    outline: 2px solid #C5A55A;
    outline-offset: 4px;
    margin: 5px;
    box-shadow: 0 2px 12px rgba(197, 165, 90, 0.15);
}

.with-flowers > * {
    position: relative;
}

.form-container {
    background: #ffffff;
    padding: 0;
    border-radius: 0;
    margin-bottom: 30px;
}

.form-middle {
    background: var(--bg-white);
    padding: 10px;
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 0px 10px rgba(0, 0, 0, 0.18);
}

.form-inner {
    background: #ffffff;
    padding: 20px;
}

.section-title {
    text-align: center;
    font-family: 'Ballet', cursive;
    font-size: 2em;
    color: #C5A55A;
    font-weight: 400;
    letter-spacing: 0;
    margin-bottom: 25px;
    position: relative;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 26px;
    z-index: 1;
    -webkit-text-stroke: var(--gold-outline-strong);
    paint-order: stroke fill;
    text-shadow: var(--gold-shadow-strong);
}

.section-title::before {
    content: '';
    position: absolute;
    inset: -8px -14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    filter: blur(12px);
    z-index: -1;
}

.present-intro {
    color: #3a2a2d;
    font-size: 1.12em;
    font-style: normal;
    font-weight: 600;
    font-family: 'Cormorant Garamond', Georgia, serif;
    line-height: 1.25;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: color 0.3s ease;
}

.collapsible-header:hover {
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 0.7em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.collapsible-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.present-section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 1;
}

.present-section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* IBAN Section Styles */
.iban-section {
    margin-bottom: 30px;
}

.payment-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px 0;
}

.payment-label {
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.payment-value {
    font-size: 0.95em;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-decoration: none;
}

a.payment-value:hover {
    color: var(--primary-color);
}

/* Present Shop Styles */
.present-shop {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 10px 0;
}

.present-container {
    flex: 1;
    overflow: hidden;
    padding: 10px 0;
}

.present-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 20px;
}

.present-item {
    flex: 0 0 calc(100% - 0px);
    max-width: 100%;
    margin-bottom: 0;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    height: 400px;
    /* iOS Safari fix */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.present-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    /* iOS Safari fix */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.present-item.flipped .present-item-inner {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.present-front, .present-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* iOS Safari fix - explicit transform and z-index */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    z-index: 1;
}

.present-front {
    cursor: pointer;
    pointer-events: auto;
}

.present-item.flipped .present-front {
    pointer-events: none;
}

.present-back {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    pointer-events: none;
    z-index: 0;
}

.present-item.flipped .present-back {
    pointer-events: auto;
    z-index: 2;
}

.present-item .form-inner {
    text-align: center;
    min-height: 340px;
    max-height: 340px;
    display: flex;
    flex-direction: column;
}

.present-back .form-inner {
    justify-content: center;
    gap: 15px;
}

.present-back h3 {
    font-size: 1.4em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.present-back input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    background: var(--bg-white);
}

.present-back input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.present-back .btn-claim {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.present-back .btn-claim:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.present-back .btn-back {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
}

.present-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 5px;
    background: var(--bg-white);
}

.present-item .form-inner h3 {
    font-size: 1.4em;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.present-item .form-inner p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 5px;
    flex-grow: 1;
}

.present-price {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 5px;
}

.btn-more-info {
    margin-top: 10px;
    padding: 8px 16px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-more-info:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Reserved present styles */
.present-item.reserved {
    opacity: 0.6;
}

.present-item.reserved .present-front {
    cursor: pointer;
}

.present-item.reserved .form-inner {
    position: relative;
}

.reserved-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(139, 38, 53, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.present-item.reserved .present-image,
.present-item.reserved h3,
.present-item.reserved p,
.present-item.reserved .present-price {
    filter: grayscale(100%);
}

.shop-nav {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.8em;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.shop-nav:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.shop-nav:active {
    transform: scale(0.95);
}

.shop-nav:disabled {
    background: var(--border-light);
    cursor: not-allowed;
    transform: none;
}

.shop-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 30px;
    max-width: 150px;
    margin-left: auto;
    margin-right: auto;
}

.shop-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.shop-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.3);
}

.shop-dot:hover {
    background-color: var(--accent-color);
}

.form-group {
    margin-bottom: 20px;
}

.name-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.name-input-container input {
    flex: 1;
}

.add-name-btn {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
    max-width: 140px;
}

.add-name-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-white);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.add-name-btn:active {
    transform: translateY(0);
}

.names-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-height: 20px;
}

.name-tag {
    background: linear-gradient(135deg, rgba(186, 163, 149, 0.2), rgba(143, 162, 149, 0.2));
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-light);
}

.name-tag span {
    color: var(--text-primary);
}

.remove-name-btn {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.remove-name-btn:hover {
    background: rgba(192, 57, 43, 1);
    transform: scale(1.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

label {
    display: block;
    margin-bottom: 6px;
    color: #C5A55A;
    font-family: 'Ballet', cursive;
    font-weight: 400;
    font-size: 1.75em;
    text-transform: none;
    letter-spacing: 0;
    -webkit-text-stroke: var(--gold-outline-strong);
    paint-order: stroke fill;
    text-shadow: var(--gold-shadow-strong);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: none;
    border-bottom: 1px solid var(--border-light);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1em;
    background: var(--bg-light);
    transition: all 0.3s;
    color: #1f1a1b;
}

input::placeholder,
textarea::placeholder {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #8d7d7f;
    font-style: italic;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-bottom-color: var(--accent-color);
    background: var(--bg-white);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-option {
    flex: 1;
}

input[type="radio"] {
    display: none;
}

.radio-label {
    display: block;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9em;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #C5A55A;
    text-shadow: var(--gold-shadow-strong);
}

input[type="radio"]:checked + .radio-label {
    background-color: var(--accent-color);
    color: var(--bg-white);
    border-color: var(--accent-color);
    text-shadow: none;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 0;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cormorant Garamond', Georgia, serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-submit:hover {
    background-color: var(--primary-hover);
}

.btn-reset {
    background-color: var(--bg-gray);
    color: var(--text-primary);
}

.btn-reset:hover {
    background-color: var(--border-light);
}

.success-message,
.error-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
}

.success-message {
    background-color: var(--success-bg);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.error-message {
    background-color: var(--error-bg);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 520px;
    margin: 0;
    opacity: 1;
    transform: none;
}

.login-embed-inner {
    text-align: center;
}

.login-embed-form {
    max-width: 320px;
    margin: 0 auto;
}

.login-title {
    margin-bottom: 10px;
}

.login-subtitle {
    margin-bottom: 24px;
}

.login-password-input {
    text-align: center;
    letter-spacing: 0.08em;
}

.login-button-group {
    justify-content: center;
    margin-top: 18px;
}

footer {
    text-align: center;
    color: #C5A55A;
    font-family: 'Ballet', cursive;
    font-size: 2.1em;
    line-height: 1.2;
    margin-top: 40px;
    -webkit-text-stroke: var(--gold-outline-strong);
    paint-order: stroke fill;
    text-shadow: var(--gold-shadow-strong);
}

footer p {
    position: relative;
    display: inline-block;
    padding: 12px 26px;
    z-index: 1;
}

footer p::before {
    content: '';
    position: absolute;
    inset: -8px -14px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    filter: blur(12px);
    z-index: -1;
}

@media (max-width: 768px) {
    body {
        background-size: 102% auto !important;
        background-position: center top !important;
    }
}

/* Nuclear dark-mode override — some mobile browsers ignore color-scheme */
@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #ffffff !important;
        color: #2d1519 !important;
    }
    .form-container, .form-inner, .iban-number {
        background-color: #ffffff !important;
    }
    input, textarea, select, .radio-label, .lang-btn, .add-name-btn {
        background-color: #ffffff !important;
        color: #2d1519 !important;
    }
}