/* ==========================================================================
   Captive Public Form Styles
   ========================================================================== */

.captive-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Grid layout — 6-column base, fields span by width */
.captive-form {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

/* Per-field width: 1=full, 2=half, 3=third */
.captive-col-1 { grid-column: span 6; }
.captive-col-2 { grid-column: span 3; }
.captive-col-3 { grid-column: span 2; }
.captive-col-full { grid-column: 1 / -1; }

/* Field styles */
.captive-field {
    display: flex;
    flex-direction: column;
}

.captive-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.captive-required {
    color: #d63638;
}

.captive-field input[type="text"],
.captive-field input[type="email"],
.captive-field input[type="tel"],
.captive-field textarea,
.captive-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.captive-field input:focus,
.captive-field textarea:focus,
.captive-field select:focus {
    border-color: #F5A623;
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.captive-field input.captive-invalid,
.captive-field textarea.captive-invalid,
.captive-field select.captive-invalid {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

.captive-field-error {
    font-size: 12px;
    color: #d63638;
    margin-top: 4px;
}

/* Checkbox & Radio */
.captive-checkbox-label,
.captive-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin-bottom: 6px;
}

.captive-checkbox-label input,
.captive-radio-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Submit button */
.captive-submit {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: #F5A623;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.captive-submit:hover {
    background: #e09510;
}

.captive-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.captive-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.captive-message-success {
    background: #e6f7e6;
    color: #1a7a1a;
    border: 1px solid #b8e6b8;
}

.captive-message-error {
    background: #fce8e8;
    color: #d63638;
    border: 1px solid #f5c6c6;
}

/* Closed state */
.captive-closed {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

.captive-error {
    color: #d63638;
    font-size: 14px;
}

/* Loading state */
.captive-submit.loading {
    position: relative;
    color: transparent;
}

.captive-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: captivePublicSpin 0.6s linear infinite;
}

@keyframes captivePublicSpin {
    to { transform: rotate(360deg); }
}

/* Responsive — stack all fields on small screens */
@media (max-width: 768px) {
    .captive-form {
        grid-template-columns: 1fr;
    }

    .captive-col-1,
    .captive-col-2,
    .captive-col-3,
    .captive-col-full {
        grid-column: 1;
    }
}
