/* ========================================
   DYNAMIC FORM RENDERER - shared by /summit and /ai-survey
   Mobile First
   ======================================== */

/* /summit moved to its own full AAES design (see summit.css) and no
   longer uses this narrow dark-theme shell — only /ai-survey still does. */
body.page-template-page-ai-survey,
body.page-template-page-ai-survey main {
    background-color: #1D1D1D !important;
}

.summit-page {
    color: #ffffff;
    font-family: "Eudoxus Sans", sans-serif;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    padding: 60px 20px 80px;
}

.kdf-page-container {
    max-width: 640px;
    margin: 0 auto;
}

.summit-banner-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.summit-banner-img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    display: block;
}

.summit-header {
    text-align: center;
    margin-bottom: 40px;
}

.summit-title {
    font-family: "Unbounded", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 10px;
}

.summit-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

@media (min-width: 768px) {
    .summit-title {
        font-size: 2.2rem;
    }
}

.kdf-container {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.kdf-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: "Eudoxus Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    transition: color 0.15s ease;
}

.kdf-back-link:hover {
    color: #ffffff;
}

.kdf-loading,
.kdf-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.kdf-error {
    color: #ff6b6b;
}

.kdf-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Progress bar */
.kdf-progress {
    display: flex;
    gap: 6px;
}

.kdf-progress-seg {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.kdf-progress-seg--active {
    background: #007cba;
}

.kdf-title {
    font-family: "Unbounded", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

/* Form-level error */
.kdf-form-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8a8a;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Questions */
.kdf-question {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 16px;
    transition: box-shadow 0.2s ease;
}

/* Highlights the specific question that failed validation and scrolls
   into view (see scrollToError in dynamic-form.js), instead of only a
   banner the visitor may have already scrolled past on a long page. */
.kdf-question--error {
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.6);
    padding: 14px;
    margin: -14px;
}

.kdf-question-error {
    color: #ff8a8a;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0;
}

.kdf-label {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
}

.kdf-required {
    color: #007cba;
}

.kdf-input,
.kdf-textarea,
.kdf-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    font-family: "Eudoxus Sans", sans-serif;
    font-size: 0.95rem;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.kdf-input::placeholder,
.kdf-textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.kdf-input:focus,
.kdf-textarea:focus,
.kdf-select:focus {
    border-color: #007cba;
    background: rgba(255, 255, 255, 0.08);
}

.kdf-textarea {
    resize: vertical;
    min-height: 100px;
}

.kdf-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 40px;
}

/* The dropdown POPUP is rendered by the browser/OS, not by our CSS box —
   it always gets a light background that author styles can't reliably
   override. The <select>'s own color:#ffffff (for the dark closed-state
   box) was inheriting into the <option> list, making every unselected/
   unhovered row white-text-on-white-popup and invisible. Force dark,
   readable text specifically on the options instead. */
.kdf-select option {
    color: #1a1a1a;
    background-color: #ffffff;
}

/* Choice options (select + checkbox share this layout) */
.kdf-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kdf-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 13px 16px;
    font-family: "Eudoxus Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.15s ease;
}

.kdf-option-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.kdf-option-btn--selected {
    background: #007cba;
    border-color: #007cba;
    color: #ffffff;
}

.kdf-checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.kdf-option-btn--selected .kdf-checkbox-box {
    background: #ffffff;
    border-color: #ffffff;
    color: #007cba;
    font-weight: 700;
}

/* Linear scale */
.kdf-scale {
    display: flex;
    gap: 8px;
}

.kdf-scale-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-family: "Eudoxus Sans", sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kdf-scale-btn--selected {
    background: #007cba;
    border-color: #007cba;
    color: #ffffff;
}

.kdf-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Star rating */
.kdf-stars {
    display: flex;
    gap: 4px;
}

.kdf-star-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    transition: color 0.15s ease;
}

.kdf-star-btn--filled {
    color: #f5c542;
}

/* Navigation */
.kdf-nav {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.kdf-back-btn {
    padding: 14px 20px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: "Eudoxus Sans", sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kdf-back-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.kdf-next-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 14px;
    border: none;
    background: #007cba;
    color: #ffffff;
    font-family: "Eudoxus Sans", sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.kdf-next-btn:hover {
    background: #0693dd;
}

.kdf-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success screen (shared shell, used by both pages) */
.kdf-success {
    text-align: center;
    padding: 60px 20px;
}

.kdf-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 124, 186, 0.15);
    color: #007cba;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 24px;
}

.kdf-success-title {
    font-family: "Unbounded", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
}

.kdf-success-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
}

/* Summit fork (Individual vs School choice) */
.kdf-fork {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kdf-fork-btn {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kdf-fork-btn:hover {
    border-color: #007cba;
    background: rgba(0, 124, 186, 0.08);
}

.kdf-fork-btn-title {
    font-family: "Unbounded", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
}

.kdf-fork-btn-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

@media (min-width: 768px) {
    .kdf-fork {
        flex-direction: row;
    }
    .kdf-fork-btn {
        flex: 1;
    }
}
