:root {
    --primary-color: #4f46e5;
    --primary-light: #818cf8;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #cbebff 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.5);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 500px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -0.05em;
}

header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-section {
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.highlight-value {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 800;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    transition: transform 0.1s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    position: relative;
    background: #e5e7eb;
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-label {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s;
    margin: 0 !important;
}

.toggle-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

#mode-employee:checked ~ .toggle-label.left,
#mode-freelance:checked ~ .toggle-label.right {
    color: var(--primary-color);
}

#mode-freelance:checked ~ .toggle-bg {
    transform: translateX(100%);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 8px;
}

/* Result Section */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-card {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: transform 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.result-card.primary h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.result-card.secondary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.result-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.amount {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.result-card.primary .amount {
    color: #ffffff;
}

.result-card.secondary .amount {
    color: var(--text-main);
    font-size: 1.8rem;
}

.result-card.secondary.sub-item .amount {
    font-size: 1.5rem;
}

.unit {
    font-size: 1rem;
    font-weight: 600;
    margin-left: 4px;
}

.result-card.secondary .unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sub-amount {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.9;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.result-card.secondary .sub-amount {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.breakdown-grid .result-card:first-child {
    grid-column: span 2;
}

@media (max-width: 480px) {
    .glass-card {
        padding: 24px 16px;
    }
    .amount {
        font-size: 2.2rem;
    }
    .result-card.secondary .amount {
        font-size: 1.6rem;
    }
    .result-card.secondary.sub-item .amount {
        font-size: 1.3rem;
    }
    .input-group label {
        font-size: 1rem;
    }
    .highlight-value {
        font-size: 1.6rem;
    }
}

/* Select Dropdown */
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Disclaimer */
.disclaimer {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px dashed rgba(0, 0, 0, 0.15);
}

.disclaimer strong {
    color: var(--text-main);
}

.disclaimer p {
    line-height: 1.6;
}
