/* =============================================================
   Anfrage Web-ED – Frontend Styles
   Alle Selektoren mit Prefix .awed- um Divi-/Theme-Konflikte zu vermeiden.
   ============================================================= */

.awed-form-wrapper {
    --awed-primary: #4f46e5;
    --awed-primary-dark: #4338ca;
    --awed-primary-light: rgba(79, 70, 229, 0.08);
    --awed-text: #111827;
    --awed-muted: #6b7280;
    --awed-border: #e5e7eb;
    --awed-border-strong: #d1d5db;
    --awed-bg: #ffffff;
    --awed-bg-soft: #f9fafb;
    --awed-radius: 14px;
    --awed-radius-sm: 10px;
    --awed-shadow: 0 2px 4px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
    --awed-shadow-hover: 0 4px 8px rgba(79, 70, 229, 0.08), 0 12px 32px rgba(79, 70, 229, 0.12);
    --awed-error: #dc2626;
    --awed-success: #10b981;

    max-width: 820px;
    margin: 32px auto;
    color: var(--awed-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    box-sizing: border-box;
}

.awed-form-wrapper *,
.awed-form-wrapper *::before,
.awed-form-wrapper *::after {
    box-sizing: border-box;
}

.awed-form {
    background: var(--awed-bg);
    border: 1px solid var(--awed-border);
    border-radius: var(--awed-radius);
    box-shadow: var(--awed-shadow);
    padding: 28px;
}

@media (max-width: 600px) {
    .awed-form {
        padding: 20px 16px;
        border-radius: 10px;
    }
    .awed-form-wrapper { margin: 16px auto; }
}

/* Fortschrittsanzeige */
.awed-progress {
    margin-bottom: 24px;
}
.awed-progress__bar {
    width: 100%;
    height: 8px;
    background: var(--awed-bg-soft);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--awed-border);
}
.awed-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--awed-primary), var(--awed-primary-dark));
    border-radius: 999px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.awed-progress__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    color: var(--awed-muted);
    font-weight: 500;
}
.awed-progress__percent { color: var(--awed-primary); font-weight: 600; }

/* Steps */
.awed-step {
    display: none;
    animation: awedFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.awed-step.is-active { display: block; }

@keyframes awedFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.awed-step__header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--awed-border);
}
.awed-step__icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--awed-primary-light);
    border-radius: 14px;
    color: var(--awed-primary);
}
.awed-step__icon svg { display: block; }

.awed-step__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--awed-text);
    line-height: 1.25;
}
.awed-step__subtitle {
    margin: 0;
    color: var(--awed-muted);
    font-size: 15px;
}

/* Felder */
.awed-step__body > .awed-field + .awed-field { margin-top: 20px; }

.awed-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--awed-text);
}
.awed-required { color: var(--awed-error); margin-left: 2px; }

.awed-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--awed-text);
    background: var(--awed-bg);
    border: 1px solid var(--awed-border-strong);
    border-radius: var(--awed-radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}
.awed-input:focus {
    outline: none;
    border-color: var(--awed-primary);
    box-shadow: 0 0 0 3px var(--awed-primary-light);
}
.awed-input--textarea { resize: vertical; min-height: 110px; }
.awed-input--select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.awed-help {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--awed-muted);
}
.awed-error {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--awed-error);
    min-height: 0;
    display: none;
}
.awed-field.has-error .awed-error { display: block; }
.awed-field.has-error .awed-input,
.awed-field.has-error .awed-yesno,
.awed-field.has-error .awed-options,
.awed-field.has-error .awed-cards {
    /* Visueller Fehler-Indikator */
}
.awed-field.has-error .awed-input {
    border-color: var(--awed-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Radio / Checkbox Liste */
.awed-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.awed-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--awed-border);
    border-radius: var(--awed-radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--awed-bg);
}
.awed-option:hover { border-color: var(--awed-primary); background: var(--awed-primary-light); }
.awed-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.awed-option__indicator {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--awed-border-strong);
    flex: 0 0 20px;
    position: relative;
    transition: all 0.15s;
}
.awed-option__indicator--square { border-radius: 5px; }
.awed-option input:checked ~ .awed-option__indicator {
    border-color: var(--awed-primary);
    background: var(--awed-primary);
}
.awed-option input:checked ~ .awed-option__indicator::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M2 7l3 3 7-7' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}
.awed-option:has(input:checked) {
    border-color: var(--awed-primary);
    background: var(--awed-primary-light);
}
.awed-option__label { font-size: 15px; color: var(--awed-text); }

/* Ja / Nein */
.awed-yesno {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.awed-yesno__btn {
    flex: 1 1 0;
    min-width: 100px;
    text-align: center;
    padding: 12px 18px;
    border: 1px solid var(--awed-border-strong);
    border-radius: var(--awed-radius-sm);
    cursor: pointer;
    font-weight: 600;
    color: var(--awed-text);
    background: var(--awed-bg);
    transition: all 0.15s;
}
.awed-yesno__btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.awed-yesno__btn:hover { border-color: var(--awed-primary); color: var(--awed-primary); }
.awed-yesno__btn:has(input:checked) {
    background: var(--awed-primary);
    color: #fff;
    border-color: var(--awed-primary);
}

/* Karten / Budget */
.awed-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.awed-card {
    cursor: pointer;
    position: relative;
}
.awed-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.awed-card__inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--awed-border);
    border-radius: var(--awed-radius);
    background: var(--awed-bg);
    transition: all 0.2s;
    height: 100%;
}
.awed-card:hover .awed-card__inner {
    border-color: var(--awed-primary);
    box-shadow: var(--awed-shadow-hover);
    transform: translateY(-2px);
}
.awed-card input:checked ~ .awed-card__inner {
    border-color: var(--awed-primary);
    background: var(--awed-primary-light);
    box-shadow: 0 0 0 2px var(--awed-primary) inset;
}
.awed-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    background: var(--awed-primary-light);
    color: var(--awed-primary);
}
.awed-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.awed-card__title { font-weight: 600; color: var(--awed-text); font-size: 15px; }
.awed-card__desc  { color: var(--awed-muted); font-size: 13px; line-height: 1.4; }

/* Datenschutz */
.awed-privacy {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    padding: 14px;
    background: var(--awed-bg-soft);
    border: 1px solid var(--awed-border);
    border-radius: var(--awed-radius-sm);
}
.awed-privacy input { position: absolute; opacity: 0; width: 0; height: 0; }
.awed-privacy .awed-option__indicator { margin-top: 2px; }
.awed-privacy input:checked ~ .awed-option__indicator {
    border-color: var(--awed-primary);
    background: var(--awed-primary);
}
.awed-privacy input:checked ~ .awed-option__indicator::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M2 7l3 3 7-7' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}
.awed-privacy__text { font-size: 14px; color: var(--awed-text); line-height: 1.5; }
.awed-privacy__text a { color: var(--awed-primary); text-decoration: underline; }

/* Hinweis nach Schritt */
.awed-step__hint {
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--awed-bg-soft);
    border-left: 3px solid var(--awed-primary);
    border-radius: 6px;
    font-size: 14px;
    color: var(--awed-muted);
    display: none;
}
.awed-step__hint.is-visible { display: block; animation: awedFadeIn 0.3s ease; }

/* Review */
.awed-review {
    background: var(--awed-bg-soft);
    border: 1px solid var(--awed-border);
    border-radius: var(--awed-radius-sm);
    padding: 4px 0;
    overflow: hidden;
}
.awed-review__section {
    padding: 14px 18px;
    border-bottom: 1px solid var(--awed-border);
}
.awed-review__section:last-child { border-bottom: 0; }
.awed-review__section h4 {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--awed-primary);
    font-weight: 700;
}
.awed-review__row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 4px 0;
    font-size: 14px;
}
.awed-review__label { color: var(--awed-muted); min-width: 160px; }
.awed-review__value { color: var(--awed-text); font-weight: 500; flex: 1; min-width: 0; word-break: break-word; }

/* Erfolgsmeldung */
.awed-success {
    text-align: center;
    padding: 32px 16px;
}
.awed-success__icon {
    width: 96px; height: 96px;
    margin: 0 auto 18px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--awed-success);
    animation: awedPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes awedPop {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.awed-success__title { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.awed-success__text  { margin: 0; color: var(--awed-muted); max-width: 480px; margin: 0 auto; }

/* Navigation */
.awed-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--awed-border);
}
.awed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--awed-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.2;
    text-decoration: none;
}
.awed-btn:focus { outline: none; box-shadow: 0 0 0 3px var(--awed-primary-light); }
.awed-btn--primary {
    background: var(--awed-primary);
    color: #fff;
    margin-left: auto;
}
.awed-btn--primary:hover { background: var(--awed-primary-dark); transform: translateY(-1px); box-shadow: var(--awed-shadow-hover); }
.awed-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.awed-btn--ghost {
    background: transparent;
    color: var(--awed-muted);
    border-color: var(--awed-border-strong);
}
.awed-btn--ghost:hover { color: var(--awed-text); border-color: var(--awed-text); }
.awed-btn[hidden] { display: none !important; }

.awed-status {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--awed-error);
    min-height: 0;
}
.awed-status.is-success { color: var(--awed-success); }

/* Divi-Schutz: bestimmte Theme-Reset-Effekte rückgängig machen */
.awed-form input[type="text"],
.awed-form input[type="email"],
.awed-form input[type="tel"],
.awed-form input[type="date"],
.awed-form textarea,
.awed-form select {
    background-color: var(--awed-bg);
    color: var(--awed-text);
}
.awed-form button { font-family: inherit; }
