/**
 * WeddingPress Access Gate Stylesheet
 * 
 * Version: 4.1.0
 * Package: WeddingPress
 */

/* Lock body scroll when Gate is active (Only in production frontend, never in editor).
   Tanpa touch-action:none: di sebagian browser itu ikut mematikan geser/zoom di kartu gerbang (keyboard HP). */
body.wdp-gate-locked:not(.elementor-editor-active):not(.elementor-editor-preview) {
    overflow: hidden !important;
    height: 100vh !important;
}

/* 100vh Overlay Container */
.wdp-access-gate-wrapper.wdp-gate-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* tinggi area yang benar-benar terlihat di HP (bilah alamat & keyboard) */
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-sizing: border-box;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
}

/* Fade out state on unlock */
.wdp-access-gate-wrapper.wdp-gate-overlay.wdp-gate-fadeout {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Background Media (Image / Video) */
.wdp-gate-bg-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.wdp-gate-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wdp-gate-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.wdp-gate-bg-video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: none;
    max-width: none !important;
    max-height: none !important;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.78vh;
}

@media (max-aspect-ratio: 16/9) {
    .wdp-gate-bg-video iframe {
        width: 177.78vh !important;
        height: 100vh !important;
        min-width: 100% !important;
        min-height: 100% !important;
    }
}

@media (min-aspect-ratio: 16/9) {
    .wdp-gate-bg-video iframe {
        width: 100vw !important;
        height: 56.25vw !important;
        min-width: 100% !important;
        min-height: 100% !important;
    }
}

.wdp-gate-bg-video video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    pointer-events: none;
}

.wdp-gate-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.45);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* Glass Blur Filter Layer (Backdrop Filter for Background Image/Video) */
.wdp-gate-bg-blur {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
}

/* Interactive Card Center Container */
/* Wadah kartu bisa digulir: saat keyboard HP terbuka atau layar landscape, kartu tidak terpotong.
   Kartu dipusatkan dengan margin:auto (bukan align-items:center) agar bagian atasnya tetap terjangkau. */
.wdp-gate-card-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.wdp-gate-card-container > .wdp-gate-card {
    margin: auto;
    flex-shrink: 0;
}

/* Dialog Box (Card) */
.wdp-gate-card {
    position: relative;
    max-width: 450px;
    width: 100%;
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 18px;
    padding: 32px 28px;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.25s ease;
}

/* Card Background Overlay */
.wdp-gate-card-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    transition: opacity 0.25s ease, background 0.25s ease, backdrop-filter 0.25s ease;
}

/* Ensure all card interactive contents sit above overlay */
.wdp-gate-card > *:not(.wdp-gate-card-overlay) {
    position: relative;
    z-index: 2;
}

/* Lock Icon Badge */
.wdp-gate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 26px;
    margin: 0 auto 16px auto;
    box-sizing: border-box;
    line-height: 1;
}

.wdp-gate-icon i,
.wdp-gate-icon svg {
    display: block;
    margin: auto;
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Typography */
.wdp-gate-title {
    font-size: 21px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.wdp-gate-subtitle {
    font-size: 13.5px;
    color: #475569;
    margin: 0 0 22px 0;
    line-height: 1.55;
}

/* Notice / Alert Box */
.wdp-gate-notice {
    display: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 18px;
    text-align: left;
    box-sizing: border-box;
    animation: wdpGateSlideDown 0.25s ease-out;
}

.wdp-gate-notice.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.wdp-gate-notice.is-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.wdp-gate-notice.is-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.wdp-gate-notice.is-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Form & Input */
.wdp-gate-form {
    margin-bottom: 18px;
}

.wdp-gate-input-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.wdp-gate-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 44px 13px 16px;
    font-size: 16px; /* < 16px membuat iOS Safari memperbesar halaman saat input difokus */
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    text-align: center;
    letter-spacing: 0.05em;
}

.wdp-gate-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tombol mata berupa <button> (bisa dijangkau keyboard): reset gaya tombol tema / Kit Elementor. */
.wdp-access-gate-wrapper .wdp-gate-toggle-eye,
.wdp-access-gate-wrapper .wdp-gate-toggle-eye:hover,
.wdp-access-gate-wrapper .wdp-gate-toggle-eye:focus {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 4px;
    margin: 0;
    min-height: 0;
    width: auto;
    line-height: 1;
    text-transform: none;
}

.wdp-gate-toggle-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    font-size: 16px;
    border-radius: 6px;
}

.wdp-gate-toggle-eye:hover {
    color: #475569;
}

.wdp-access-gate-wrapper .wdp-gate-toggle-eye:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.wdp-access-gate-wrapper:focus {
    outline: none;
}

/* Submit Button */
.wdp-gate-submit-btn {
    width: 100%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border: none;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wdp-gate-submit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.wdp-gate-submit-btn:active {
    transform: translateY(0);
}

.wdp-gate-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner */
.wdp-gate-spinner {
    display: inline-flex;
    animation: wdpGateSpin 0.9s linear infinite;
}

/* WhatsApp Help Button */
.wdp-gate-help-wrapper {
    margin-top: 14px;
}

.wdp-gate-help-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #059669;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.08);
    transition: all 0.2s ease;
}

.wdp-gate-help-btn:hover {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
}

/* Shake Animation (Error state) */
.wdp-gate-card.wdp-gate-shake {
    animation: wdpGateShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes wdpGateShake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

@keyframes wdpGateSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wdpGateSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    /* PD-64: placeholder PIN tidak terpotong di HP sempit; ukuran ketik tetap 16px (iOS) */
    .wdp-gate-input::placeholder {
        font-size: 0.875em;
        letter-spacing: normal;
    }
    .wdp-gate-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .wdp-gate-title {
        font-size: 19px;
    }
    .wdp-gate-subtitle {
        font-size: 13px;
    }
    .wdp-gate-icon {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}

/* ==========================================================================
   Elementor Editor Preview Mode (Full Screen Live Preview)
   ========================================================================== */
.wdp-access-gate-wrapper.wdp-gate-editor-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2005 !important; /* TA-1: di atas cover Invitation (.modalx 2000-2002) di editor */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wdp-access-gate-wrapper.wdp-gate-editor-mode .wdp-gate-card-container {
    padding: 20px !important;
    position: relative !important;
    z-index: 10 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wdp-gate-editor-banner {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 6px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    white-space: nowrap;
}

.wdp-gate-editor-banner .wdp-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.wdp-access-gate-editor-collapsed {
    transition: all 0.2s ease;
}

.wdp-access-gate-editor-collapsed:hover {
    border-color: #94a3b8 !important;
    background: #f1f5f9 !important;
}
