@import url('variables.css');

/* ═══════════════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════════════ */
html {
    height: 100dvh;
}

body {
    font-family: var(--ff);
    background: #f7f7f7;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════ */
#wizardMain {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 2.5rem; /* mehr Luft unten → Card wirkt optisch zentriert */
}

#wizardHero {
    width: 100%;
    max-width: 760px;
    padding: 0 0.5rem 1rem;
    text-align: left;
}

#wizardHeroTitle {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1d1d1b;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

#wizardHeroSub {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   WIZARD CARD
═══════════════════════════════════════════════════════════════════ */
#wizardCard {
    width: 100%;
    max-width: 760px;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(190, 200, 206, 0.3);
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS INDICATOR
   Kreise und Linie in einem Wrapper → absolute Linie zentriert auf
   die Kreise, unabhängig von Label-Höhe.
═══════════════════════════════════════════════════════════════════ */
#progressContainer {
    flex-shrink: 0;
    padding: 1rem 2rem 0.75rem;
    border-bottom: 1px solid rgba(190, 200, 206, 0.15);
}

/* progressWrapper ist der relative Anker für die absolute Linie */
#progressWrapper {
    position: relative;
}

/* lineWrapper: von Kreismitte-links bis Kreismitte-rechts (je 16px = halber Kreisdurchmesser) */
#lineWrapper {
    position: absolute;
    top: 16px;           /* vertikale Mitte der 32px-Kreise */
    left: 16px;
    right: 16px;
    height: 2px;
    z-index: 0;
}

#progressLine {
    position: absolute;
    inset: 0;
    background: #eae8e7;
}

#progressLineActive {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.5s ease;
}

/* Kreis-Zeile — jedes step-item enthält Kreis + Label */
#progressSteps {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
}

/* Kreis und Label in einer Spalte, zentriert.
   flex: 0 0 32px → item-Breite = Kreisdurchmesser,
   damit left/right: 16px auf #lineWrapper exakt auf die Kreiszentren trifft. */
.step-item {
    flex: 0 0 32px;
    min-width: 0;      /* verhindert dass min-width:auto den Item aufweitet */
    max-width: 32px;   /* garantiert exakt 32px → Kreiszentrum = left/right: 16px */
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    outline: 4px solid #fff;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.step-active  { background: var(--primary); color: #fff; }
.step-done    { background: #bde9ff;        color: #00475d; }
.step-pending { background: #eae8e7;        color: #6e797e; }

/* Label direkt unter dem Kreis — wird automatisch von .step-item zentriert */
.step-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #6e797e;
    text-align: center;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   STEPS CONTAINER & ANIMATIONS
═══════════════════════════════════════════════════════════════════ */
#stepsContainer {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.wizard-step {
    display: none;
    animation-duration: 300ms;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.wizard-step.active {
    display: block;
}

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

@keyframes slideInLeft {
    from { transform: translateX(-48px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

.slide-in-right { animation-name: slideInRight; }
.slide-in-left  { animation-name: slideInLeft;  }

/* ═══════════════════════════════════════════════════════════════════
   STEP CONTENT LAYOUT
═══════════════════════════════════════════════════════════════════ */
.step-content {
    padding: 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.step-centered {
    align-items: center;
    text-align: center;
    padding-top: 1.5rem;
    padding-bottom: 1.25rem;
}

.step-icon-wrap {
    margin-bottom: 0.25rem;
}

.step-icon {
    font-size: 2.2rem;
    color: var(--primary);
    opacity: 0.85;
}

.step-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1b1c1c;
    margin-bottom: 0.2rem;
}

.step-subtext {
    font-size: var(--md);
    color: #6e797e;
    max-width: 420px;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   LABELS
═══════════════════════════════════════════════════════════════════ */
.inputLabel {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #6e797e;
    padding-left: 2px;
    margin-top: 0.4rem;
}

.optional-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.72rem;
}

/* ═══════════════════════════════════════════════════════════════════
   INPUTS — Rainbow-Border-Focus via ::after pseudo-element
   (konsistent mit bestehendem Pattern des Projekts)
═══════════════════════════════════════════════════════════════════ */
.input-wrapper {
    position: relative;
    border-radius: 12px;
    background: #fff;
    align-self: stretch;
}

.input-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    border: 2px solid var(--primary, #006684);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.input-wrapper:focus-within::after {
    opacity: 1;
}

.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d0d7db;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: var(--ff);
    background: #f5f5f5;
    padding: 0.65rem 1rem;
    outline: none;
    color: #1b1c1c;
    transition: border-color 0.2s ease, background 0.2s ease;
    display: block;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: none;
}

.input-wrapper textarea {
    resize: none;
    line-height: 1.6;
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
    color: #aab0b5;
}

/* Validation states */
.input-wrapper.has-error input,
.input-wrapper.has-error textarea {
    border-color: var(--Red);
}

.input-wrapper.has-error::after {
    background: var(--Red);
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════
   ERROR TEXT
═══════════════════════════════════════════════════════════════════ */
.error-text {
    color: var(--Red);
    font-size: 0.82rem;
    margin-top: 2px;
    min-height: 1rem;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   STEP 2 — ADDRESS / GEOLOCATION
═══════════════════════════════════════════════════════════════════ */
.address-input-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
    align-items: stretch;
}

.address-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1.5px solid #bec8ce;
    border-radius: 10px;
    font-size: var(--md);
    font-family: inherit;
    color: #1b1c1c;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}

.address-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 132, 0.12);
}

.my-location-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--primary);
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.my-location-btn:hover {
    background: var(--primary);
    color: #fff;
}

.address-suggestions {
    width: 100%;
    background: #fff;
    border: 1.5px solid #bec8ce;
    border-radius: 10px;
    margin-top: 0.25rem;
    overflow: hidden;
    display: none;
}

.address-suggestions.open {
    display: block;
}

.address-suggestion-item {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    color: #1b1c1c;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-item:hover {
    background: #f3f8fb;
}

/* ═══════════════════════════════════════════════════════════════════
   STEP 3 — FOTO UPLOAD
═══════════════════════════════════════════════════════════════════ */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 1.2rem 1rem;
    border-radius: 16px;
    border: 2.5px dashed #c0c8cc;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: #f0faff;
}

.upload-icon {
    font-size: 2.2rem;
    color: #aab0b5;
    transition: color 0.2s;
}

.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
    color: var(--primary);
}

.upload-hint {
    font-size: var(--md);
    color: #8a9499;
}

/* Image preview grid */
.image-preview {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-top: 1rem;
    box-sizing: border-box;
}

.preview-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    background: #f0f0f0;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.img-remove-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #E2001A;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 22px;
    text-align: center;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════
   STEP 4 — KONTAKT
═══════════════════════════════════════════════════════════════════ */
#emailTelefonField {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d0d7db;
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--ff);
    background: #f5f5f5;
    padding: 0.85rem 1rem;
    outline: none;
    color: #1b1c1c;
    transition: border-color 0.2s ease, background 0.2s ease;
}

#emailTelefonField:focus {
    border-color: var(--primary);
    background: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   SUCCESS SCREEN
═══════════════════════════════════════════════════════════════════ */
#successBox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 0 0.5rem;
}

#backToHomeText {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: var(--Purple);
    color: #fff;
    font-weight: 700;
    font-size: var(--md);
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#backToHomeText:hover {
    opacity: 0.88;
    transform: scale(1.03);
}

/* ═══════════════════════════════════════════════════════════════════
   WIZARD NAVIGATION FOOTER
═══════════════════════════════════════════════════════════════════ */
#wizardNav {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 2rem 1rem;
    border-top: 1px solid rgba(190, 200, 206, 0.15);
}

#btnBack,
#btnNext {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--ff);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

#btnNext {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 102, 132, 0.30);
    margin-left: auto;
}

#btnNext:hover { opacity: 0.88; transform: scale(1.04); }
#btnNext:active { transform: scale(0.97); }

#btnBack {
    background: transparent;
    color: #6e797e;
    padding-left: 0.5rem;
}

#btnBack:hover { color: var(--primary); }

#btnBack.hidden { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #wizardCard { border-radius: 22px; }

    #progressContainer { padding: 0.85rem 1.2rem 0.65rem; }

    .step-content { padding: 1rem 1.2rem; }

    #wizardNav { padding: 0.7rem 1.2rem 0.85rem; }
}

@media (max-width: 480px) {
    #wizardMain { padding: 0.5rem 0.5rem; }

    #wizardCard { border-radius: 18px; }

    #progressContainer { padding: 0.7rem 1rem 0.55rem; }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.68rem;
    }

    .step-item { flex: 0 0 28px; min-width: 0; max-width: 28px; }

    #lineWrapper {
        top: 14px;  /* halber 28px-Kreisdurchmesser */
        left: 14px;
        right: 14px;
    }

    .step-content { padding: 0.9rem 1rem; }

    .step-heading { font-size: 1.05rem; }

    .image-preview { grid-template-columns: repeat(2, 1fr); }

    #wizardNav { padding: 0.6rem 1rem 0.75rem; }

    #btnNext, #btnBack {
        font-size: 0.72rem;
        padding: 0.55rem 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   LOCATION SPINNER
═══════════════════════════════════════════════════════════════════ */
#location-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid rgba(85, 185, 225, 0.25);
    border-top-color: var(--Blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 0.5rem;
}

#location-spinner[hidden] {
    display: none;
}

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


/* ── Veröffentlichungs-Einwilligung (Schritt 3) ─────────────────────────────── */
.consent-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.consent-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--primary, #006684);
    font-weight: 600;
}

.consent-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary, #006684);
    cursor: pointer;
}

.consent-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--primary, #006684);
    cursor: help;
    outline: none;
}

.consent-help .consent-tooltip {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max(220px, 18rem);
    max-width: 80vw;
    background: #1f2933;
    color: #fff;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
    pointer-events: none;
}

.consent-help .consent-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2933;
}

.consent-help:hover .consent-tooltip,
.consent-help:focus .consent-tooltip,
.consent-help:focus-within .consent-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
