/* Nettolohn-Rechner — site-specific styles */

/* Layout: two-column on desktop */
.tool-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .tool-layout {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    .result-panel {
        position: sticky;
        top: 1rem;
    }
}

/* Hero */
.hero {
    margin-bottom: 1.5rem;
}
.hero p {
    font-size: 1.1rem;
    max-width: 600px;
}

/* Form card */
.form-card {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 1rem;
}
.form-group:last-child {
    margin-bottom: 0;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    color: var(--color-text);
}
.form-group .hint {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Input with unit suffix */
.input-unit {
    position: relative;
}
.input-unit input {
    padding-right: 3rem;
}
.input-unit .unit {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}
.toggle-row label {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
    cursor: pointer;
}
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}
.toggle-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.toggle-switch input:checked + .toggle-track {
    background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-track {
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Action buttons row */
.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.form-actions button {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    white-space: nowrap;
}
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover {
    background: var(--color-border);
}

/* Result panel */
.result-panel {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}
.result-panel h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.result-primary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.result-metric {
    text-align: center;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.result-metric .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}
.result-metric .label {
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-top: 0.25rem;
}
.result-metric.highlight {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

/* Secondary result grid */
.result-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.result-secondary .result-metric {
    padding: 0.75rem;
}
.result-secondary .result-metric .value {
    font-size: 1.25rem;
}

/* Breakdown table */
.breakdown-table {
    width: 100%;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 0.5rem;
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--color-border);
}
.breakdown-row:last-child {
    border-bottom: none;
}
.breakdown-row .breakdown-label {
    color: var(--color-muted);
}
.breakdown-row .breakdown-value {
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}
.breakdown-row.deduction .breakdown-value {
    color: var(--color-accent);
}
.breakdown-row.total {
    border-top: 2px solid var(--color-border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    font-weight: 700;
}
.breakdown-row.total .breakdown-label {
    color: var(--color-text);
}
.breakdown-row.total .breakdown-value {
    color: var(--color-primary);
    font-size: 1rem;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.result-actions button {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    line-height: 1.4;
}
.disclaimer a {
    color: var(--color-muted);
    text-decoration: underline;
}

/* Sticky result bar (mobile) */
.sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 2px solid var(--color-primary);
    padding: 0.75rem 1rem;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}
.sticky-bar.visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.sticky-bar .sticky-values {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}
.sticky-bar .sticky-metric {
    text-align: center;
    min-width: 0;
}
.sticky-bar .sticky-metric .value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}
.sticky-bar .sticky-metric .label {
    font-size: 0.625rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sticky-bar button {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .sticky-bar { display: none !important; }
}
@media (prefers-color-scheme: dark) {
    .sticky-bar { box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4); }
}

/* Accordion / details */
.accordion {
    margin-top: 2rem;
}
.accordion details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.accordion summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
    content: "\25B8";
    transition: transform 0.2s;
    font-size: 0.875rem;
    color: var(--color-muted);
}
.accordion details[open] summary::after {
    transform: rotate(90deg);
}
.accordion .accordion-body {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-muted);
}

/* Calculation steps */
.calc-steps {
    list-style: none;
    counter-reset: step;
}
.calc-steps li {
    counter-increment: step;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.calc-steps li:last-child {
    border-bottom: none;
    font-weight: 600;
    color: var(--color-text);
}
.calc-steps li::before {
    content: counter(step) ".";
    color: var(--color-primary);
    font-weight: 600;
    min-width: 1.5rem;
}
.calc-steps .step-result {
    font-weight: 600;
    white-space: nowrap;
}

/* Content sections */
.content-section {
    margin-top: 2.5rem;
}
.content-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}
.content-section p {
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* Example cards */
.example-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .example-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.example-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.example-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.example-card .detail {
    font-size: 0.85rem;
    color: var(--color-muted);
    line-height: 1.5;
}
.example-card .result-highlight {
    margin-top: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Related tools */
.related-tools {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .related-tools {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
.related-tool-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    transition: border-color 0.15s;
}
.related-tool-card:hover {
    border-color: var(--color-primary);
    text-decoration: none;
}
.related-tool-card h3 {
    font-size: 0.9375rem;
    color: var(--color-text);
    margin-bottom: 0.375rem;
}
.related-tool-card p {
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* Share toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--color-text);
    color: var(--color-bg);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 200;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
@media (max-width: 767px) {
    .toast { bottom: 5rem; }
}

/* Wider max-width for this tool */
main {
    max-width: 960px;
}

/* Print styles */
@media print {
    .sticky-bar,
    .form-actions,
    .result-actions,
    .toast { display: none !important; }
    .result-panel { position: static; }
    body { background: #fff; color: #000; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
