.korespa-form-wrapper {
    margin: 20px 0;
}

.korespa-form .krf-form-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

.korespa-form .krf-field {
    margin-bottom: 20px;
}

.korespa-form .krf-field-width-1  { grid-column: span 1; }
.korespa-form .krf-field-width-2  { grid-column: span 2; }
.korespa-form .krf-field-width-3  { grid-column: span 3; }
.korespa-form .krf-field-width-4  { grid-column: span 4; }
.korespa-form .krf-field-width-5  { grid-column: span 5; }
.korespa-form .krf-field-width-6  { grid-column: span 6; }
.korespa-form .krf-field-width-7  { grid-column: span 7; }
.korespa-form .krf-field-width-8  { grid-column: span 8; }
.korespa-form .krf-field-width-9  { grid-column: span 9; }
.korespa-form .krf-field-width-10 { grid-column: span 10; }
.korespa-form .krf-field-width-11 { grid-column: span 11; }
.korespa-form .krf-field-width-12 { grid-column: span 12; }

@media (max-width: 768px) {
    .korespa-form .krf-form-row {
        grid-template-columns: 1fr;
    }
    .korespa-form .krf-field {
        grid-column: span 12 !important;
    }
}

.korespa-form .krf-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.korespa-form .krf-required {
    color: #dc3232;
}

.korespa-form .krf-input,
.korespa-form .krf-textarea,
.korespa-form .krf-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.korespa-form .krf-input:focus,
.korespa-form .krf-textarea:focus,
.korespa-form .krf-select:focus {
    border-color: #0073aa;
    outline: none;
}

.korespa-form .krf-textarea {
    resize: vertical;
    min-height: 100px;
}

.korespa-form .krf-submit-btn {
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.korespa-form .krf-submit-btn:hover {
    background: #005a87;
}

.korespa-form .krf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.korespa-form .krf-radio-group,
.korespa-form .krf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.korespa-form .krf-radio-label,
.korespa-form .krf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.korespa-form .krf-separator {
    border: none;
    border-top: 1px solid #dddddd;
    margin: 20px 0;
}

.korespa-form .krf-heading {
    margin: 0 0 20px 0;
}

.korespa-form .krf-html-field {
    margin-bottom: 20px;
}

.korespa-form .krf-help-text {
    display: block;
    font-size: 12px;
    color: #666666;
    margin-top: 4px;
}

.korespa-form .krf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.korespa-form .krf-file {
    display: block;
}

.korespa-form .krf-form-actions {
    margin-top: 20px;
}

.korespa-form .krf-form-messages {
    margin-top: 16px;
}

.korespa-form .krf-success-message {
    color: #46b450;
    font-size: 16px;
    padding: 12px;
    text-align: center;
    background: #f0fff4;
    border: 1px solid #46b450;
    border-radius: 4px;
    display: none;
}

.korespa-form .krf-error-message-global {
    color: #dc3232;
    font-size: 14px;
    padding: 12px;
    text-align: center;
    background: #fff0f0;
    border: 1px solid #dc3232;
    border-radius: 4px;
    display: none;
}

.korespa-form .krf-field .krf-error-message {
    color: #dc3232;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.korespa-form .krf-field.has-error .krf-input,
.korespa-form .krf-field.has-error .krf-textarea,
.korespa-form .krf-field.has-error .krf-select {
    border-color: #dc3232;
}

.korespa-form .krf-field.has-error .krf-error-message {
    display: block;
}

/* Korespa Magazine: keep every public form legible in its explicit dark mode. */
html[data-korespa-color-mode="dark"] .korespa-form {
    color: var(--ink, #f4f0e8);
}

html[data-korespa-color-mode="dark"] .korespa-form .krf-label,
html[data-korespa-color-mode="dark"] .korespa-form .krf-radio-label,
html[data-korespa-color-mode="dark"] .korespa-form .krf-checkbox-label,
html[data-korespa-color-mode="dark"] .korespa-form .krf-consent-label,
html[data-korespa-color-mode="dark"] .korespa-form .krf-heading,
html[data-korespa-color-mode="dark"] .korespa-form .krf-html-field {
    color: var(--ink, #f4f0e8);
}

html[data-korespa-color-mode="dark"] .korespa-form .krf-help-text {
    color: var(--muted, #b5afa5);
}

html[data-korespa-color-mode="dark"] .korespa-form .krf-input,
html[data-korespa-color-mode="dark"] .korespa-form .krf-textarea,
html[data-korespa-color-mode="dark"] .korespa-form .krf-select {
    border-color: var(--line, #3b3933);
    background: var(--paper, #1b1a17);
    color: var(--ink, #f4f0e8);
    color-scheme: dark;
}

html[data-korespa-color-mode="dark"] .korespa-form .krf-input::placeholder,
html[data-korespa-color-mode="dark"] .korespa-form .krf-textarea::placeholder {
    color: var(--muted, #b5afa5);
    opacity: 1;
}

html[data-korespa-color-mode="dark"] .korespa-form .krf-separator {
    border-color: var(--line, #3b3933);
}

html[data-korespa-color-mode="dark"] .korespa-form .krf-success-message,
html[data-korespa-color-mode="dark"] .korespa-form .krf-error-message-global {
    background: var(--paper, #1b1a17);
}

@media (prefers-color-scheme: dark) {
    html[data-korespa-color-mode="auto"] .korespa-form {
        color: var(--ink, #f4f0e8);
    }

    html[data-korespa-color-mode="auto"] .korespa-form .krf-label,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-radio-label,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-checkbox-label,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-consent-label,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-heading,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-html-field {
        color: var(--ink, #f4f0e8);
    }

    html[data-korespa-color-mode="auto"] .korespa-form .krf-help-text {
        color: var(--muted, #b5afa5);
    }

    html[data-korespa-color-mode="auto"] .korespa-form .krf-input,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-textarea,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-select {
        border-color: var(--line, #3b3933);
        background: var(--paper, #1b1a17);
        color: var(--ink, #f4f0e8);
        color-scheme: dark;
    }

    html[data-korespa-color-mode="auto"] .korespa-form .krf-input::placeholder,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-textarea::placeholder {
        color: var(--muted, #b5afa5);
        opacity: 1;
    }

    html[data-korespa-color-mode="auto"] .korespa-form .krf-separator {
        border-color: var(--line, #3b3933);
    }

    html[data-korespa-color-mode="auto"] .korespa-form .krf-success-message,
    html[data-korespa-color-mode="auto"] .korespa-form .krf-error-message-global {
        background: var(--paper, #1b1a17);
    }
}
