/* Domestic Help Salary Calculator - Premium Styles */
body {
    background-color: #030303;
}

.apple-glass {
    background: rgba(18, 18, 20, 0.6);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.text-glow-emerald {
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
}

.bg-subtle-grid-emerald {
    background-size: 60px 60px;
    background-image:
        linear-gradient(to right, rgba(16, 185, 129, 0.01) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 185, 129, 0.01) 1px, transparent 1px);
}

/* Customized Range Sliders matching Apple aesthetics */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

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

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.25);
}

/* Custom interactive input styling */
.custom-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease-in-out;
}

.custom-input:focus {
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

/* Native select control matched to the custom-input treatment.
   Kept at 44px min height so the touch target passes the mobile
   guideline used across the rest of the tool suite. */
.custom-select {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fafafa;
    min-height: 44px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.15rem;
    padding-right: 2.25rem;
    transition: all 0.2s ease-in-out;
}

.custom-select:focus {
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.custom-select optgroup,
.custom-select option {
    background-color: #131315;
    color: #fafafa;
}

/* Task chips — a checkbox styled as a selectable pill. The checkbox
   itself stays in the DOM (visually hidden) so the control remains
   keyboard reachable and announced by screen readers. */
.task-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.18s ease-in-out;
    user-select: none;
}

.task-chip:hover {
    border-color: rgba(16, 185, 129, 0.35);
}

.task-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.task-chip .chip-box {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
    transition: all 0.18s ease-in-out;
}

.task-chip input:checked ~ .chip-box {
    background: #10b981;
    border-color: #10b981;
    color: #04150f;
}

.task-chip:has(input:checked) {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.1);
}

.task-chip input:focus-visible ~ .chip-box {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* A task that is already part of the selected role: shown as included
   rather than hidden, so the user can see what the base rate covers. */
.task-chip.is-included {
    cursor: not-allowed;
    opacity: 0.55;
    border-style: dashed;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.06);
}

.task-chip.is-included .chip-box {
    background: rgba(16, 185, 129, 0.35);
    border-color: rgba(16, 185, 129, 0.35);
    color: #ffffff;
}

/* Breakdown ladder rows */
.factor-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.factor-row:last-child {
    border-bottom: 0;
}

.factor-row.is-total {
    border-top: 1px solid rgba(16, 185, 129, 0.3);
    border-bottom: 0;
    margin-top: 0.35rem;
    padding-top: 0.75rem;
}

/* ── Light theme overrides ───────────────────────────────────────────── */
html:not(.dark) {
    background-color: #f5f5f7;
}

html:not(.dark) body {
    background-color: #f5f5f7;
}

html:not(.dark) .apple-glass {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

html:not(.dark) .apple-card {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.01) 0%, rgba(0, 0, 0, 0.02) 100%);
    border-color: rgba(0, 0, 0, 0.05);
}

html:not(.dark) .apple-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.03) 100%);
}

html:not(.dark) input[type="range"] {
    background: rgba(0, 0, 0, 0.1);
}

html:not(.dark) input[type="range"]::-webkit-slider-thumb {
    background: #10b981;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

html:not(.dark) input[type="range"]::-moz-range-thumb {
    background: #10b981;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

html:not(.dark) .custom-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
}

html:not(.dark) .custom-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

html:not(.dark) .custom-select {
    background-color: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.12);
    color: #18181b;
}

html:not(.dark) .custom-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

html:not(.dark) .custom-select optgroup,
html:not(.dark) .custom-select option {
    background-color: #ffffff;
    color: #18181b;
}

html:not(.dark) .task-chip {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.1);
}

html:not(.dark) .task-chip .chip-box {
    border-color: rgba(0, 0, 0, 0.25);
}

html:not(.dark) .task-chip:has(input:checked) {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.45);
}

html:not(.dark) .task-chip.is-included {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.3);
}

html:not(.dark) .factor-row {
    border-bottom-color: rgba(0, 0, 0, 0.07);
}

html:not(.dark) .bg-subtle-grid-emerald {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.01) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.01) 1px, transparent 1px);
}

/* Narrow phones (≈375px): let the factor ladder wrap to two lines
   instead of squeezing three columns into the width. */
@media (max-width: 400px) {
    .factor-row {
        grid-template-columns: 1fr auto;
    }

    .factor-row .factor-effect {
        grid-column: 1 / -1;
        text-align: left;
    }
}
