/* Password Gate (gate-specific styles).
   Shared chrome (ghost grid, overlay, card, icon, title, description) is
   handled by gate-lock.css via Gate_Renderer::shared_asset_decl(). */

.fotogrids-gate .fg-lock-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Per-gallery username field for browser credential storage. Visually hidden
   but still focusable/parseable by password managers - display:none and
   visibility:hidden are deliberately avoided because credential managers
   skip those. */
.fotogrids-gate .fg-lock-user {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.fotogrids-gate .fg-lock-input-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.fotogrids-gate .fg-lock-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1.5px solid #d4d4d8;
    border-radius: 7px;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #18181b;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
    /* Prevent WordPress admin styles from bleeding in */
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.fotogrids-gate .fg-lock-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.fotogrids-gate .fg-lock-input::placeholder {
    color: #a1a1aa;
}

.fotogrids-gate .fg-lock-submit {
    flex-shrink: 0;
    padding: 9px 18px;
    background: #18181b;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.fotogrids-gate .fg-lock-submit:hover {
    background: #3f3f46;
}

.fotogrids-gate .fg-lock-submit:active {
    background: #52525b;
}

.fotogrids-gate .fg-lock-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fotogrids-gate .fg-lock-error {
    font-size: 0.8125rem;
    color: #dc2626;
    text-align: left;
    display: none; /* shown via JS on unlock failure */
    margin: 0;
    line-height: 1.4;
}

.fotogrids-gate .fg-lock-error.is-visible {
    display: block;
}

/* Loading spinner - applied to .fg-gate-card by JS during form submission */

.fotogrids-gate .fg-gate-card.is-loading .fg-lock-submit {
    position: relative;
    color: transparent;
}

.fotogrids-gate .fg-gate-card.is-loading .fg-lock-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fg-lock-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .fotogrids-gate .fg-gate-card.is-loading .fg-lock-submit::after {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.35);
    }
}
