/* ==========================================================================
   Izabel Baptism RSVP - Stylesheet
   ========================================================================== */

/* Custom Properties
   ========================================================================== */
:root {
    --bg: #FDF5F0;
    --primary: #C4687A;
    --secondary: #E8A0B0;
    --light: #F5D5DC;
    --gold: #C9A84C;
    --text: #5C3A42;
    --text-secondary: #8B6570;
    --success: #7BA68A;
    --error: #C4505A;
    --white: #FFFFFF;
}

/* Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Raleway', sans-serif;
    color: #5C3A42;
    background: #FDF5F0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout
   ========================================================================== */
.page-wrapper {
    display: grid;
    grid-template-columns: 45fr 55fr;
    grid-template-rows: 1fr;
    height: 100vh;
    overflow: hidden;
}

.invitation-panel {
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #FEF8F4 0%, #F5E6DD 70%, #EDD8CE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.invitation-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    filter: drop-shadow(0 4px 20px rgba(92, 58, 66, 0.12));
}

.rsvp-panel {
    overflow-y: auto;
    background: linear-gradient(135deg, var(--bg) 0%, var(--white) 50%, var(--bg) 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 2rem;
}

.rsvp-container {
    max-width: 480px;
    width: 100%;
}

/* Header
   ========================================================================== */
.rsvp-header {
    text-align: center;
    margin-bottom: 2rem;
}

.rsvp-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.02em;
    margin-bottom: 0.3rem;
}

.rsvp-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Decorative Divider
   ========================================================================== */
.decorative-divider {
    display: flex;
    align-items: center;
    margin: 1.2rem 0;
}

.decorative-divider::before,
.decorative-divider::after {
    content: '';
    flex: 1;
    height: 1px;
}

.decorative-divider::before {
    background: linear-gradient(to right, transparent, var(--gold));
}

.decorative-divider::after {
    background: linear-gradient(to left, transparent, var(--gold));
}

/* Form Groups
   ========================================================================== */
.form-group {
    margin-bottom: 1.4rem;
    animation: fadeIn 0.5s ease both;
}

.form-group:nth-child(2) {
    animation-delay: 0.05s;
}

.form-group:nth-child(3) {
    animation-delay: 0.1s;
}

.form-group:nth-child(4) {
    animation-delay: 0.15s;
}

.form-group:nth-child(5) {
    animation-delay: 0.2s;
}

.form-group:nth-child(6) {
    animation-delay: 0.25s;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--error);
}

.optional {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85em;
}

/* Text Inputs
   ========================================================================== */
.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.form-group input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 104, 122, 0.15);
}

.form-group input[type="text"].error {
    border-color: var(--error);
}

.form-group input[type="text"]::placeholder {
    color: #C4A0A8;
}

/* Error Messages
   ========================================================================== */
.error-message {
    display: block;
    min-height: 0;
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 0.3rem;
    transition: all 0.3s;
}

.error-message:empty {
    display: none;
}

.hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.3rem;
}

/* Children Dynamic Inputs
   ========================================================================== */
.children-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.children-inputs:not(:empty) {
    margin-bottom: 0.5rem;
}

.child-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease both;
}

.child-row input[type="text"] {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.child-row input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 104, 122, 0.15);
}

.child-row input[type="text"]::placeholder {
    color: #C4A0A8;
}

.remove-child-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(196, 80, 90, 0.1);
    color: var(--error);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-child-btn:hover {
    background: rgba(196, 80, 90, 0.2);
    transform: scale(1.1);
}

.add-child-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border: 2px dashed var(--secondary);
    border-radius: 50px;
    background: transparent;
    color: var(--primary);
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.2rem;
}

.add-child-btn:hover {
    background: rgba(232, 160, 176, 0.1);
    border-color: var(--primary);
}

.add-child-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

/* Toggle Groups (Pill Buttons)
   ========================================================================== */
.toggle-group {
    display: flex;
    align-items: stretch;
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid var(--secondary);
    background: var(--white);
    transition: border-color 0.3s;
}

.toggle-group.error {
    border-color: var(--error);
}

.toggle-group .toggle-option {
    flex: 1;
    position: relative;
    display: flex;
    align-self: stretch;
    margin-bottom: 0;
}

.toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0.7rem 1.5rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.toggle-option input[type="radio"]:checked + .toggle-label {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    font-weight: 600;
}

.toggle-option input[type="radio"]:focus-visible + .toggle-label {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Submit Button
   ========================================================================== */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--primary), #D4889A);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 104, 122, 0.3);
    margin-top: 0.5rem;
    animation: fadeIn 0.5s ease both;
    animation-delay: 0.3s;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #B35868, var(--primary));
    box-shadow: 0 6px 20px rgba(196, 104, 122, 0.4);
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
}

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

.btn-loading {
    display: none;
    align-items: center;
}

.btn-loading:not([hidden]) {
    display: inline-flex;
}

/* Spinner
   ========================================================================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Results
   ========================================================================== */
.form-result {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 16px;
    animation: fadeIn 0.5s ease;
}

.form-result.success h2 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.form-result.success p {
    color: var(--text-secondary);
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--success);
    color: var(--white);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.form-result.error {
    background: rgba(196, 80, 90, 0.08);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.form-result.error p {
    color: var(--error);
    font-size: 0.9rem;
}

/* Info Section
   ========================================================================== */
.info-section {
    margin-top: 1.5rem;
    text-align: center;
}

.info-note {
    font-style: italic;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
}

.info-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.info-text a:hover {
    border-bottom-color: var(--primary);
}

.info-signature {
    margin-top: 1.2rem;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.8;
}

.info-signature a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.info-signature a:hover {
    text-decoration: underline;
}

/* reCAPTCHA
   ========================================================================== */
.recaptcha-notice {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light);
}

.recaptcha-notice a {
    color: var(--text-secondary);
    text-decoration: underline;
}

.grecaptcha-badge {
    visibility: hidden !important;
}

/* Animations
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive
   ========================================================================== */
@media (max-width: 1023px) {
    .page-wrapper {
        grid-template-columns: 42fr 58fr;
    }
}

@media (max-width: 767px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: 100vh;
    }

    .invitation-image {
        height: auto;
        object-fit: contain;
    }

    .rsvp-panel {
        padding: 1.5rem 1rem;
    }

    .rsvp-container {
        max-width: 100%;
    }

    .rsvp-header h1 {
        font-size: 1.8rem;
    }

    .toggle-label {
        padding: 0.6rem 1rem;
    }
}
