/* ========================================
   @group Login
   Gregory & Shannen's Wedding - March 25, 2026
   ======================================== */

/* ========================================
   @group Background
   Login container & champagne gradient background
   ======================================== */

/* Fixed champagne background that never scrolls */
.login-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 20%, #F5E8D8 0%, var(--champagne-light) 35%, var(--champagne) 55%, var(--champagne-dark) 75%, #B59674 100%);
    z-index: -1;
}

/* Ensure body background matches to prevent white flash */
body {
    background: #D4C4A8;
    /* Fallback color matching gradient */
    background: radial-gradient(circle at 50% 20%, #F5E8D8 0%, var(--champagne-light) 35%, var(--champagne) 55%, var(--champagne-dark) 75%, #B59674 100%);
    background-attachment: fixed;
}

.login-container {
    min-height: 100vh;
    position: relative;
    padding: 80px 20px;
    /* 80px top and bottom padding for card */
    display: flex;
    justify-content: center;
}


/* Hide default messages container - we handle them custom */
body>main>.container:first-child {
    display: none;
}

/* Removed unused: .login-page-message */

/* Fade in animation for HTMX-inserted messages */
#message-container .wedding-message {
    animation: messageFadeIn 0.3s ease-in;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   @group Flip Card
   Wedding card container and flip transition
   ======================================== */

/* @component Flip Card Container */
.wedding-card-animated {
    display: grid;
    grid-template: 1fr / 1fr;
    /* Single cell for stacking */
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    /* Height is now determined by grid content */
    margin: 0 auto;
    /* JavaScript will control all transforms */
    will-change: transform;
    opacity: 0;
}

/* Visible state */
.wedding-card-animated.visible {
    opacity: 1;
}

/* Only the flip uses CSS transition */
.wedding-card-animated.enable-flip-transition {
    transition: transform 1s ease-in-out;
}

/* ========================================
   @group Card Faces
   Front and back faces of the flip card
   ======================================== */

/* @component Card Faces */
.card-front,
.card-back {
    grid-area: 1 / 1;
    /* Both occupy the same grid cell */
    width: 100%;
    min-height: 100%;
    /* Allow growth beyond 100% if needed */
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-front {
    background: white;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
}

/* ========================================
   @group Photo
   ======================================== */

/* @component Photo Container */
.photo-container {
    width: 100%;
    aspect-ratio: 998 / 1500;
    /* Exact photo ratio */
    overflow: hidden;
    flex-shrink: 0;
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   @group Form
   ======================================== */

.login-section {
    /* Natural height based on content */
    padding: 30px 20px 70px 20px;
    /* Doubled top and bottom padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* No overflow - let content expand the card */
}

/* Form Labels - Left aligned */
.login-section .form-label {
    text-align: left;
}

/* Ensure form controls inherit the body font and consistent sizing */
.login-section .form-control,
.login-section .btn {
    font-family: inherit;
    /* Use Inter font like the rest of the page */
    font-size: 1rem;
    /* Match label size exactly */
}

/* Center specific elements */
.login-section .wedding-header,
.login-section .palm-tree-icon,
.login-section .couple-names,
.login-section .text-body-secondary,
.login-section .d-grid,
.login-section .text-center {
    text-align: center;
}

/* tighter line-height for login names across all sizes */
.login-section .couple-names {
    line-height: 0.78;
}

/* removed stacked-specific margin; using global sizes + mobile-only or always-on breaks */

/* @component Login Submit Button
   Keep label centered; spinner overlays during submit */
.login-submit-btn {
    position: relative;
    /* allow centered overlay spinner */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Keep button width stable: hide label but preserve space */
.htmx-request .login-submit-btn .login-submit-label {
    visibility: hidden;
}

/* Center spinner overlay while request is active */
.htmx-request .login-submit-btn .htmx-indicator {
    position: absolute;
    inset: 0;
    /* top/right/bottom/left: 0 */
    margin: auto;
    /* center within button without using transform */
}

/* Prevent double-clicks without changing Bootstrap disabled styling */
.htmx-request .login-submit-btn {
    pointer-events: none;
}

/* Palm Tree Icon sizing now matches core page header via
   the shared SVG include and wedding.css responsive rules. */

/* Stacked couple names variant for login header */
/* removed stacked-specific font sizing; rely on .script-title */

/* ========================================
   @group Responsive
   ======================================== */

/* Tablets and Small Laptops */
@media (max-width: 768px) {
    .wedding-card-animated {
        width: 95%;
        max-width: 400px;
    }



    /* Palm tree sizing inherited from .palm-page-header in wedding.css */

    .login-section {
        padding: 40px 15px 60px 15px;
        /* Doubled top and bottom padding */
    }

    /* Consistent form sizing on mobile */
    .login-section .form-control {
        font-size: 1rem;
        /* Standard size */
    }

    .login-section .form-label {
        font-size: 1rem;
        /* Standard size */
    }


}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-section {
        padding: 30px 20px 60px 20px;
        /* Doubled top and bottom padding for tablet */
    }

    /* Palm tree sizing inherited from .palm-page-header in wedding.css */

    /* no local couple-names sizing overrides */
}

/* Very Small Screens */
@media (max-width: 480px) and (max-height: 700px) {
    .login-section {
        padding: 20px 10px 40px 10px;
        /* Doubled top and bottom padding */
    }

    /* no local couple-names sizing overrides */
}
