/* ============================================
   DKSB Euskirchen - Kontakt-Modal Styles
   Multi-Step Formular
   ============================================ */

/* === Modal Overlay === */
.contact-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.contact-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === Modal Container === */
.contact-modal {
    background: var(--bg-white, #ffffff);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.contact-modal-overlay.active .contact-modal {
    transform: translateY(0) scale(1);
}

/* === Modal Header === */
.contact-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px 20px;
    border-bottom: 1px solid var(--border-color, #e9e9eb);
}

.contact-modal__header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark, #222222);
    margin: 0;
}

.contact-modal__close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-light, #f5f5f5);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.contact-modal__close svg {
    width: 20px;
    height: 20px;
    color: var(--text-medium, #555e68);
}

.contact-modal__close:hover {
    background: var(--primary-blue, #0064ad);
}

.contact-modal__close:hover svg {
    color: white;
}

.contact-modal__close:focus-visible {
    outline: 3px solid var(--primary-orange, #ec7c32);
    outline-offset: 2px;
}

/* === Progress Steps === */
.contact-modal__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 30px;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.progress-step__number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light, #e9e9eb);
    color: var(--text-medium, #555e68);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.progress-step.active .progress-step__number,
.progress-step.completed .progress-step__number {
    background: var(--primary-blue, #0064ad);
    color: white;
}

.progress-step.completed .progress-step__number {
    background: var(--accent-teal, #00ae97);
}

.progress-step__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light, #a2a8b4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.progress-step.active .progress-step__label,
.progress-step.completed .progress-step__label {
    color: var(--text-dark, #222222);
}

.progress-step__line {
    flex: 1;
    height: 3px;
    background: var(--bg-light, #e9e9eb);
    margin: 0 15px;
    margin-bottom: 28px;
    min-width: 40px;
    max-width: 80px;
    transition: background 0.3s ease;
}

.progress-step__line.completed {
    background: var(--accent-teal, #00ae97);
}

/* === Form Container === */
.contact-modal__form {
    padding: 0 30px 30px;
}

/* === Form Steps === */
.contact-modal__step {
    display: none;
}

.contact-modal__step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.contact-modal__step-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark, #222222);
    margin: 0 0 24px 0;
}

/* === Form Groups === */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #222222);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--global-palette13, #b82105);
}

.form-label .optional {
    color: var(--text-light, #a2a8b4);
    font-weight: 400;
}

/* === Text Inputs === */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-dark, #222222);
    background: var(--bg-white, #ffffff);
    border: 2px solid var(--border-color, #e9e9eb);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue, #0064ad);
    box-shadow: 0 0 0 3px rgba(0, 100, 173, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--global-palette13, #b82105);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light, #a2a8b4);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23555e68'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

/* === Hints & Errors === */
.form-hint {
    display: block;
    font-size: 13px;
    color: var(--text-light, #a2a8b4);
    margin-top: 6px;
}

.form-error {
    display: none;
    font-size: 13px;
    color: var(--global-palette13, #b82105);
    margin-top: 6px;
}

.form-error.visible {
    display: block;
}

/* === Radio Buttons === */
fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0 0 20px 0;
}

fieldset.form-group legend {
    padding: 0;
    margin-bottom: 12px;
}

.form-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.form-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-radio__custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color, #e9e9eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.form-radio__custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-blue, #0064ad);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.form-radio input:checked + .form-radio__custom {
    border-color: var(--primary-blue, #0064ad);
}

.form-radio input:checked + .form-radio__custom::after {
    transform: scale(1);
}

.form-radio input:focus-visible + .form-radio__custom {
    outline: 3px solid var(--primary-orange, #ec7c32);
    outline-offset: 2px;
}

.form-radio__label {
    font-size: 15px;
    color: var(--text-dark, #222222);
}

/* === Checkbox === */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.form-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-checkbox__custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--border-color, #e9e9eb);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.form-checkbox__custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.form-checkbox input:checked + .form-checkbox__custom {
    background: var(--primary-blue, #0064ad);
    border-color: var(--primary-blue, #0064ad);
}

.form-checkbox input:checked + .form-checkbox__custom::after {
    transform: rotate(45deg) scale(1);
}

.form-checkbox input:focus-visible + .form-checkbox__custom {
    outline: 3px solid var(--primary-orange, #ec7c32);
    outline-offset: 2px;
}

.form-checkbox__label {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-medium, #555e68);
}

.form-checkbox__label a {
    color: var(--primary-blue, #0064ad);
    text-decoration: underline;
}

.form-checkbox__label a:hover {
    color: var(--primary-orange, #ec7c32);
}

/* === File Upload === */
.form-file {
    position: relative;
}

.form-file__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-file__label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-light, #f5f5f5);
    border: 2px dashed var(--border-color, #e9e9eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-file__label:hover {
    border-color: var(--primary-blue, #0064ad);
    background: rgba(0, 100, 173, 0.05);
}

.form-file__input:focus-visible + .form-file__label {
    outline: 3px solid var(--primary-orange, #ec7c32);
    outline-offset: 2px;
}

.form-file__label svg {
    width: 24px;
    height: 24px;
    color: var(--text-light, #a2a8b4);
}

.form-file__text {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-blue, #0064ad);
}

.form-file__name {
    display: inline-block;
    font-size: 13px;
    color: var(--text-light, #a2a8b4);
    margin-top: 8px;
    margin-right: 8px;
    word-break: break-word;
    max-width: 100%;
}

.form-file__name.has-file {
    color: var(--accent-teal, #00ae97);
    font-weight: 500;
}

.form-file__remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid #d9534f;
    color: #d9534f;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    vertical-align: middle;
}

.form-file__remove:hover,
.form-file__remove:focus-visible {
    background: #d9534f;
    color: #fff;
    outline: none;
}

.form-file__remove[hidden] {
    display: none;
}

.form-file__remove svg {
    flex-shrink: 0;
}

/* === Navigation Buttons === */
.contact-modal__nav {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e9e9eb);
}

.contact-modal__btn-prev {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-modal__btn-prev svg,
.contact-modal__btn-next svg,
.contact-modal__btn-submit svg {
    width: 18px;
    height: 18px;
}

.contact-modal__btn-next,
.contact-modal__btn-submit {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-modal__btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button loading state */
.contact-modal__btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.contact-modal__btn-submit.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* === Success & Error States === */
.contact-modal__success,
.contact-modal__error {
    padding: 40px 30px;
    text-align: center;
}

.success-icon,
.error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon {
    background: rgba(0, 174, 151, 0.1);
}

.success-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent-teal, #00ae97);
}

.error-icon {
    background: rgba(184, 33, 5, 0.1);
}

.error-icon svg {
    width: 48px;
    height: 48px;
    color: var(--global-palette13, #b82105);
}

.contact-modal__success h3,
.contact-modal__error h3 {
    font-size: 22px;
    margin: 0 0 12px 0;
    color: var(--text-dark, #222222);
}

.contact-modal__success p,
.contact-modal__error p {
    font-size: 15px;
    color: var(--text-medium, #555e68);
    margin: 0 0 24px 0;
    line-height: 1.6;
}

/* === Mobile Responsive === */
@media (max-width: 600px) {
    .contact-modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .contact-modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }

    .contact-modal__header {
        padding: 20px;
    }

    .contact-modal__header h2 {
        font-size: 20px;
    }

    .contact-modal__progress {
        padding: 16px 20px;
    }

    .progress-step__label {
        display: none;
    }

    .progress-step__line {
        margin-bottom: 0;
    }

    .contact-modal__form {
        padding: 0 20px 20px;
    }

    .form-radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .contact-modal__nav {
        flex-direction: column;
    }

    .contact-modal__btn-prev {
        order: 2;
    }
}

/* === Print === */
@media print {
    .contact-modal-overlay {
        display: none !important;
    }
}
