*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #0b0f19;
    --bg-card: #111827;
    --bg-input: rgba(255, 255, 255, 0.05);
    --border-input: rgba(255, 255, 255, 0.1);
    --accent-darkblue: #1e6286;
    --accent-lightblue: #559fc6;
    --color-green: #00ea79;
    --color-red: #ff5252;
    --text-muted: #a0aec0;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    background-color: #3a80a6 !important;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;

    overscroll-behavior-y: none;

    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body {
    background: linear-gradient(135deg,
            var(--bg-dark) 0%,
            var(--bg-card) 100%);
    background-attachment: fixed;

    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 100 !important;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    font-style: normal;
    color: #ffffff;
}

.pwa-header-circle {
    position: relative;
    background: linear-gradient(135deg, var(--accent-darkblue) 0%, var(--accent-lightblue) 100%);
    border-bottom-left-radius: 36px;
    border-bottom-right-radius: 36px;
    width: 100%;
    padding-top: calc(env(safe-area-inset-top) + 32px);
    padding-bottom: 28px;
    padding-left: 20px;
    padding-right: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    font-family:
        "Lato",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif !important;
}

.pwa-header-circle::before {
    content: "";
    position: absolute;
    top: -200px;
    left: 0;
    right: 0;
    height: 200px;
    background: var(--accent-darkblue);
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 420px;
    margin: 0 auto;
}

.endkapital-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.endkapital-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.endkapital-row {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
}

.endkapital-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
}

.svg-copy {
    width: 18px;
    height: 18px;
    margin-left: 12px;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s ease, transform 0.15s ease;

    /* Für optische Ausrichtung neben dem €-Zeichen */
    margin-top: 3px; 
}

.svg-copy:active {
    transform: scale(0.85);
    color: #ffffff;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 14px 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-column {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.stat-num {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    transition:
        color 0.3s ease,
        text-shadow 0.3s ease;
}

.stat-num.positive {
    color: var(--color-green);
    text-shadow: 0 2px 10px rgba(0, 230, 118, 0.35);
}

.stat-num.negative {
    color: var(--color-red);
    text-shadow: 0 2px 10px rgba(255, 82, 82, 0.35);
}

.form-container {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 420px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 14px;
    padding: 14px 42px 14px 16px;
    line-height: 1.2;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    font-family: inherit;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-wrapper input:focus {
    border-color: rgba(30, 98, 134, 0.6);
    background: rgba(30, 98, 134, 0.03);
    box-shadow: 0 0 10px rgba(30, 98, 134, 0.08);
}

.input-wrapper .unit {
    position: absolute;
    right: 16px;
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input:focus+.unit {
    color: var(--accent-darkblue);
}

input::placeholder {
    color: #cccccc;
    opacity: 0.25;
}

.segmented-control {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 14px;
    padding: 4px;
    gap: 4px;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 11px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;

    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;

    transition: background 0.12s ease-out,
        color 0.12s ease-out,
        transform 0.12s ease-out,
        box-shadow 0.12s ease-out;
    transform: scale(0.98);
}

.segmented-control input[type="radio"]:checked+label {
    background: linear-gradient(135deg,
            var(--accent-darkblue) 0%,
            var(--accent-lightblue) 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-darkblue) 35%, transparent);
    transform: scale(1);
}

.segmented-control label:active {
    transform: scale(0.94);
    transition: transform 0.05s ease-out;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    background: linear-gradient(135deg,
            var(--accent-darkblue) 0%,
            var(--accent-lightblue) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    gap: 8px;
    transition: all 0.2s ease;
}

.secondary-btn:active,
.reset-btn:active {
    transform: scale(0.98);
}

.share-icon, 
.reset-icon {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2.25;
    margin-top: 0.5px;
}

#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition:
        transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.3s ease;
    z-index: 999;
}

#toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    
    margin-top: 16px; 
    margin-bottom: env(safe-area-inset-bottom, 20px);
    
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);

    font-weight: 400;
}

.footer-content svg {
    width: calc(1em + 0.1px);
    height: calc(1em + 0.1px);
    display: block;
}




/* 2. Ganz unten in deinem CSS einfügen, damit auch Inputs, Buttons & Labels dünn werden: */
input, button, label {
    font-weight: 500 !important;
}