/* ==========================================================================
   Gehaltsrechner Plugin v3 – Perspective-Funnel-Stil
   Mobile-first, fadeUp-Animationen, Gradient-BG, grosse Touch-Targets
   ========================================================================== */

/* -- 1. CSS Custom Properties -- */
:root {
    --gr-primary: #1B4D3E;
    --gr-accent: #B8956A;
    --gr-gradient-1: #F4F7F5;
    --gr-gradient-2: #FBF9F6;
    --gr-bg: #FAFBFC;
    --gr-text: #4A5D68;
    --gr-heading: #1A2A2E;
    --gr-muted: #7A8B95;
    --gr-border: #e2e8f0;
    --gr-error: #dc2626;
    --gr-radius: 12px;
    --gr-radius-lg: 20px;
    --gr-transition: 0.25s ease;
}

/* -- 2. Animated Gradient Background -- */
.gehaltsrechner-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(135deg, var(--gr-gradient-1) 0%, var(--gr-gradient-2) 50%, var(--gr-gradient-1) 100%);
    background-size: 400% 400%;
    animation: gr-gradient-shift 12s ease infinite;
    border-radius: var(--gr-radius-lg);
    font-family: var(--gr-font-family, 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif);
    position: relative;
    color: var(--gr-text-color, var(--gr-text));
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes gr-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* -- 3. Dark Theme -- */
.gehaltsrechner-wrap.theme-dark {
    --gr-gradient-1: #1a1a2e;
    --gr-gradient-2: #16213e;
    --gr-bg: #1e293b;
    --gr-text: #f1f5f9;
    --gr-border: #334155;
    --gr-muted: #94a3b8;
}

/* -- 4. Progress Bar -- */
.gr-progress {
    height: 4px;
    background: rgba(0,0,0,.06);
    border-radius: 2px;
    margin: 0;
    overflow: hidden;
}

.gr-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gr-primary), var(--gr-accent));
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

/* -- 5. Card Stack -- */
.gr-card-stack {
    position: relative;
    min-height: 420px;
}

/* -- 6. Cards -- */
.gr-card {
    display: none;
    padding: 40px 32px;
    opacity: 0;
}

.gr-card.active {
    display: block;
    opacity: 1;
    animation: gr-fadeUp 0.25s ease forwards;
}

.gr-card.fade-out {
    animation: gr-fadeOut 0.2s ease forwards;
}

/* -- 7. Card Animations: fadeUp -- */
@keyframes gr-fadeUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes gr-fadeOut {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-10px); opacity: 0; }
}

/* -- 8. Card Titles -- */
.gr-card-title {
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 700;
    color: var(--gr-heading-color, var(--gr-heading));
    margin: 0 0 24px;
    text-align: center;
    line-height: 1.3;
}

.gr-card-subtitle {
    font-size: 15px;
    color: var(--gr-muted);
    text-align: center;
    margin: -12px 0 24px;
    line-height: 1.5;
}

.gr-card-hint {
    font-size: 13px;
    color: var(--gr-muted);
    text-align: center;
    margin: -12px 0 16px;
}

/* -- 9. Intro Card -- */
.gr-intro {
    text-align: center;
    padding: 48px 16px 32px;
}

.gr-intro-title {
    font-size: clamp(26px, 6vw, 34px);
    font-weight: 800;
    color: var(--gr-heading-color, var(--gr-heading));
    margin: 0 0 12px;
    line-height: 1.2;
}

.gr-intro-subtitle {
    color: var(--gr-muted);
    font-size: 16px;
    margin: 0 0 36px;
    line-height: 1.5;
}

.gr-intro-hint {
    font-size: 13px;
    color: var(--gr-muted);
    margin-top: 12px;
}

/* -- 10. Float Labels -- */
.gr-field {
    position: relative;
    margin-bottom: 20px;
}

.gr-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 18px;
    border: 1.5px solid var(--gr-border);
    border-radius: var(--gr-radius);
    font-size: 16px;
    background: rgba(255,255,255,.8);
    color: var(--gr-text);
    transition: var(--gr-transition);
    appearance: none;
    -webkit-appearance: none;
}

.theme-dark .gr-field input {
    background: rgba(30,41,59,.8);
}

.gr-field label {
    position: absolute;
    left: 18px;
    top: 16px;
    color: var(--gr-muted);
    font-size: 16px;
    transition: var(--gr-transition);
    pointer-events: none;
}

.gr-field input:focus + label,
.gr-field input:not(:placeholder-shown) + label {
    top: -8px;
    left: 14px;
    font-size: 12px;
    background: var(--gr-gradient-1);
    padding: 0 6px;
    color: var(--gr-primary);
    border-radius: 4px;
}

.gr-field input:focus {
    outline: none;
    border-color: var(--gr-primary);
    box-shadow: 0 0 0 4px rgba(27,77,62,.1);
}

.gr-field input.invalid {
    border-color: var(--gr-error);
    box-shadow: 0 0 0 4px rgba(220,38,38,.08);
}

.gr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* -- 11. Visual Choice Grid -- */
.gr-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.gr-choice-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.gr-choice-card {
    background: rgba(255,255,255,.85);
    border: 2px solid var(--gr-border);
    border-radius: var(--gr-radius);
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.theme-dark .gr-choice-card {
    background: rgba(30,41,59,.7);
}

.gr-choice-card:hover {
    border-color: var(--gr-primary);
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.gr-choice-card:active {
    transform: scale(0.98);
}

.gr-choice-card.selected {
    border-color: var(--gr-accent);
    background: rgba(245,166,35,.1);
    box-shadow: 0 0 0 3px rgba(245,166,35,.15);
}

.gr-choice-card-large {
    padding: 28px 20px;
}

.gr-choice-icon {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
}

.gr-choice-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gr-text);
    line-height: 1.3;
}

/* -- 12. Chips Grid -- */
.gr-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.gr-chip {
    padding: 12px 20px;
    border: 1.5px solid var(--gr-border);
    border-radius: 24px;
    background: rgba(255,255,255,.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gr-text);
    min-height: 48px;
    user-select: none;
}

.theme-dark .gr-chip {
    background: rgba(30,41,59,.7);
}

.gr-chip:hover {
    border-color: var(--gr-primary);
    transform: scale(1.05);
}

.gr-chip:active {
    transform: scale(0.97);
}

.gr-chip.selected {
    background: var(--gr-primary);
    border-color: var(--gr-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(27,77,62,.25);
}

/* -- 13. PLZ + Map Layout -- */
.gr-plz-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.gr-plz-input-section {
    width: 100%;
    max-width: 320px;
}


.gr-plz-region {
    font-size: 15px;
    font-weight: 600;
    color: var(--gr-primary);
    margin-top: 8px;
    text-align: center;
}

/* -- 14. Consent -- */
.gr-consent-field {
    border-top: 1px solid var(--gr-border);
    padding-top: 24px;
    margin-top: 8px;
}

.gr-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--gr-muted);
    cursor: pointer;
    user-select: none;
    line-height: 1.5;
}

.gr-consent-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gr-checkbox-box {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--gr-border);
    border-radius: 6px;
    transition: var(--gr-transition);
    background: rgba(255,255,255,.8);
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
}

.gr-consent-label input:checked + .gr-checkbox-box {
    background: var(--gr-primary);
    border-color: var(--gr-primary);
}

.gr-consent-label input:checked + .gr-checkbox-box::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.gr-consent-label a {
    color: var(--gr-primary);
    text-decoration: underline;
}

/* -- 15. Buttons -- */
.gr-btn {
    padding: 14px 28px;
    border-radius: var(--gr-radius);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    min-height: 48px;
}

.gr-btn-start {
    background: var(--gr-primary);
    color: #fff;
    padding: 16px 40px;
    font-size: 18px;
    border-radius: var(--gr-radius);
}

.gr-btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(27,77,62,.25);
}

.gr-btn-submit,
.gr-btn-cta {
    background: var(--gr-primary);
    color: #fff;
    width: 100%;
}

.gr-btn-submit:hover,
.gr-btn-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(27,77,62,.2);
}

.gr-btn-next {
    background: var(--gr-primary);
    color: #fff;
    flex: 1;
}

.gr-btn-next:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(27,77,62,.2);
}

.gr-btn-back {
    background: transparent;
    color: var(--gr-muted);
    border: 1.5px solid var(--gr-border);
    flex: 0 0 auto;
    padding: 14px 20px;
}

.gr-btn-back:hover {
    background: rgba(255,255,255,.5);
}

.gr-btn-restart {
    background: transparent;
    color: var(--gr-primary);
    border: 1.5px solid var(--gr-border);
    margin-top: 8px;
    width: 100%;
}

.gr-btn-restart:hover {
    background: rgba(255,255,255,.5);
}

.gr-card-nav {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.gr-btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* -- 16. Error -- */
.gr-error {
    color: var(--gr-error);
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
    display: block;
}

/* -- 17. Result Card -- */
.gr-result-card {
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 40px 32px;
}

.gr-result-header {
    margin-bottom: 24px;
}

.gr-result-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: gr-bounceIn .5s;
}

.gr-result-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gr-heading-color, var(--gr-heading));
    margin: 0 0 8px;
}

.gr-result-subtitle {
    color: var(--gr-muted);
    font-size: 15px;
    margin: 0;
}

/* -- 18. Level Badge -- */
.gr-level-section {
    margin: 24px 0;
}

.gr-level-label {
    font-size: 14px;
    color: var(--gr-muted);
    margin-bottom: 8px;
}

.gr-level-badge {
    display: inline-block;
    background: var(--gr-accent);
    color: #fff;
    padding: 10px 28px;
    border-radius: 24px;
    font-size: 18px;
    font-weight: 700;
    animation: gr-pulse 2s infinite;
}

/* -- 19. SVG Gauge -- */
.gr-gauge-container {
    margin: 24px auto;
    max-width: 220px;
}

.gr-gauge {
    width: 100%;
    height: auto;
}

.gr-gauge-fill {
    transition: stroke-dashoffset 1.5s cubic-bezier(.4,0,.2,1);
}

.gr-gauge-text {
    font-size: 14px;
    font-weight: 600;
    fill: var(--gr-text);
}

.gr-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gr-muted);
    margin-top: -8px;
}

/* -- 20. Matched Skills + Info -- */
.gr-skills-matched {
    background: rgba(27,77,62,.06);
    padding: 14px 18px;
    border-radius: var(--gr-radius);
    font-size: 14px;
    margin: 16px 0;
}

.gr-result-info {
    background: rgba(22,163,74,.06);
    border: 1.5px solid rgba(22,163,74,.2);
    border-radius: var(--gr-radius);
    padding: 14px 18px;
    font-size: 14px;
    margin: 16px 0;
    color: #166534;
}

.theme-dark .gr-result-info {
    color: #86efac;
    background: rgba(22,163,74,.1);
    border-color: rgba(22,163,74,.15);
}

.gr-result-cta {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* -- 21. Confetti (CSS-only) -- */
.gr-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.gr-confetti.active span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: gr-confetti-fall 2.5s ease-out forwards;
}

.gr-confetti.active span:nth-child(1)  { left:  5%; animation-delay: 0s;    background: var(--gr-primary); }
.gr-confetti.active span:nth-child(2)  { left: 12%; animation-delay: 0.1s;  background: var(--gr-accent); }
.gr-confetti.active span:nth-child(3)  { left: 20%; animation-delay: 0.05s; background: #3b82f6; }
.gr-confetti.active span:nth-child(4)  { left: 28%; animation-delay: 0.15s; background: #ef4444; }
.gr-confetti.active span:nth-child(5)  { left: 35%; animation-delay: 0.03s; background: #10b981; }
.gr-confetti.active span:nth-child(6)  { left: 42%; animation-delay: 0.2s;  background: var(--gr-primary); }
.gr-confetti.active span:nth-child(7)  { left: 50%; animation-delay: 0.08s; background: var(--gr-accent); }
.gr-confetti.active span:nth-child(8)  { left: 57%; animation-delay: 0.35s; background: #3b82f6; }
.gr-confetti.active span:nth-child(9)  { left: 63%; animation-delay: 0.12s; background: #ef4444; }
.gr-confetti.active span:nth-child(10) { left: 70%; animation-delay: 0.25s; background: #10b981; }
.gr-confetti.active span:nth-child(11) { left: 76%; animation-delay: 0.18s; background: var(--gr-primary); }
.gr-confetti.active span:nth-child(12) { left: 82%; animation-delay: 0.4s;  background: var(--gr-accent); }
.gr-confetti.active span:nth-child(13) { left: 88%; animation-delay: 0.22s; background: #3b82f6; }
.gr-confetti.active span:nth-child(14) { left: 93%; animation-delay: 0.45s; background: #ef4444; }
.gr-confetti.active span:nth-child(15) { left: 97%; animation-delay: 0.3s;  background: #10b981; }

@keyframes gr-confetti-fall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* -- 22. Bounce-In Animation -- */
@keyframes gr-bounceIn {
    0%   { transform: scale(0); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* -- 23. Pulse Animation -- */
@keyframes gr-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* -- 24. Responsive: Mobile-first -- */
@media (max-width: 520px) {
    .gehaltsrechner-wrap {
        max-width: calc(100vw - 32px);
        margin: 16px auto;
        border-radius: 16px;
    }

    .gr-card {
        padding: 32px 20px;
    }

    .gr-row {
        grid-template-columns: 1fr;
    }

    .gr-choice-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .gr-choice-card {
        padding: 16px 10px;
    }

    .gr-choice-icon {
        font-size: 28px;
    }



    .gr-intro {
        padding: 36px 12px 24px;
    }
}

@media (max-width: 360px) {
    .gr-card {
        padding: 24px 16px;
    }

    .gr-choice-grid {
        grid-template-columns: 1fr;
    }

    .gr-chips-grid {
        gap: 8px;
    }

    .gr-chip {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* -- 25. Larger screens -- */
@media (min-width: 768px) {
    .gehaltsrechner-wrap {
        margin: 40px auto;
        box-shadow: 0 20px 60px rgba(0,0,0,.08);
    }
}
