/**
 * Editor styles for the wpuf/post-form block.
 */

/* ── Template picker grid ── */
.wpuf-pf-templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.components-base-control span.components-base-control__label,
.components-base-control label {
    margin-top: .5rem;
}

/* ── Template card ── */
.wpuf-pf-template-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    text-align: right;
}

.wpuf-pf-template-card:hover {
    border-color: #949494;
}

.wpuf-pf-template-card.is-active {
    border-color: var(--wp-admin-theme-color, #3858e9);
    box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #3858e9);
}

/* ── Checkmark badge ── */
.wpuf-pf-template-card__badge {
    display: none;
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wp-admin-theme-color, #3858e9);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    z-index: 1;
}

.wpuf-pf-template-card.is-active .wpuf-pf-template-card__badge {
    display: flex;
}

/* ── Realistic form mini-preview ── */
.wpuf-pf-template-preview {
    padding: 12px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 4px 4px 0 0;
    transition: background 0.15s ease;
}

.wpuf-pf-template-preview__row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wpuf-pf-template-preview__label {
    height: 4px;
    width: 40%;
    border-radius: 2px;
    opacity: 0.7;
}

.wpuf-pf-template-preview__input {
    height: 16px;
    border-radius: 3px;
    border-style: solid;
}

.wpuf-pf-template-preview__button {
    height: 14px;
    width: 50%;
    border-radius: 3px;
    margin-top: 2px;
    align-self: flex-start;
}

/* ── Card text ── */
.wpuf-pf-template-card__info {
    padding: 8px 10px;
    border-top: 1px solid #f0f0f0;
}

.wpuf-pf-template-card__label {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    color: #1e1e1e;
    line-height: 1.4;
}

.wpuf-pf-template-card__desc {
    font-size: 11px;
    color: #757575;
    margin: 2px 0 0;
    line-height: 1.3;
}

/* ── SSR loading overlay ── */
.wpuf-ssr-loading-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    z-index: 5;
}

.wpuf-ssr-loading {
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: var(--wp-admin-theme-color, #3858e9);
    border-radius: 50%;
    animation: wpuf-spin 0.6s linear infinite;
}

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

