/* Dedicated stylesheet for /forms/:slug pages. Scoped under .fp- to avoid
   colliding with the main site stylesheet. */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f6f8;
    color: #1f2937;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.fp-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fp-logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.fp-logo img {
    display: block;
    height: 36px;
    width: auto;
}

.fp-back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fp-back:hover,
.fp-back:focus-visible {
    background: #e5e7eb;
    border-color: #d1d5db;
    outline: none;
}

.fp-back svg {
    flex-shrink: 0;
}

.fp-title {
    flex: 1;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    color: #111827;
}

.fp-main {
    flex: 1;
    display: flex;
    padding: 0;
    background: #ffffff;
}

.fp-iframe {
    display: block;
    width: 100%;
    border: 0;
    /* Fallback then prefer dynamic viewport height on iOS */
    min-height: 600px;
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
}

.fp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: #6b7280;
}

.fp-footer a {
    color: #2563eb;
    text-decoration: none;
}

.fp-footer a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 768px) {
    .fp-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    .fp-logo img { height: 28px; }
    .fp-title {
        flex: 1 0 100%;
        font-size: 1rem;
        order: 3;
    }
    .fp-back {
        padding: 0.4rem 0.65rem;
        font-size: 0.85rem;
    }
    .fp-iframe {
        height: calc(100vh - 160px);
        height: calc(100dvh - 160px);
    }
    .fp-footer {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}
