/* ============================================================
   SETTINGS — Premium Financial App (inset grouped list)
   ============================================================ */

.settings-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2.5rem;
}

/* ── Section ── */
.settings-section {
    margin-bottom: 2.25rem;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 0 4px 0.7rem 4px;
}

.settings-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--teal);
    opacity: 0.5;
    flex-shrink: 0;
}

.settings-section-title[style*="red"]::before {
    background: var(--red);
}

/* ── Card (inset, no border) ── */
.settings-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0.5px 1px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .settings-card {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.settings-card-accent {
    box-shadow: 0 0 0 1px var(--teal), 0 2px 8px var(--teal-glow);
}

/* ── Row ── */
.settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    min-height: 56px;
    cursor: default;
    transition: background 0.18s ease;
}

.settings-row:hover {
    background: var(--hover-bg);
}

.settings-row + .settings-row-divider {
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--border) 5%, var(--border) 95%, transparent 100%);
    margin: 0;
    opacity: 0.5;
}

.settings-row:last-child + .settings-row-divider {
    display: none;
}

/* ── Icon ── */
.settings-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.settings-row-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 50%);
    pointer-events: none;
}

.settings-row-icon svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.settings-icon-teal {
    background: linear-gradient(135deg, var(--teal), color-mix(in srgb, var(--teal) 70%, #000));
    color: #fff;
    box-shadow: 0 2px 8px var(--teal-glow);
}

.settings-icon-red {
    background: linear-gradient(135deg, #E53E3E, #C53030);
    color: #fff;
    box-shadow: 0 2px 8px rgba(229,62,62,0.25);
}

.settings-icon-blue {
    background: linear-gradient(135deg, #3182CE, #2B6CB0);
    color: #fff;
    box-shadow: 0 2px 8px rgba(49,130,206,0.25);
}

.settings-icon-green {
    background: linear-gradient(135deg, #38A169, #2F855A);
    color: #fff;
    box-shadow: 0 2px 8px rgba(56,161,105,0.25);
}

.settings-icon-purple {
    background: linear-gradient(135deg, #805AD5, #6B46C1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(128,90,213,0.25);
}

.settings-icon-orange {
    background: linear-gradient(135deg, #DD6B20, #C05621);
    color: #fff;
    box-shadow: 0 2px 8px rgba(221,107,32,0.25);
}

/* ── Content (label + desc) ── */
.settings-row-content {
    flex: 1;
    min-width: 0;
}

.settings-row-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.settings-row-desc {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Right action area ── */
.settings-row-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    opacity: 0.3;
    flex-shrink: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.settings-action-btn:hover .settings-chevron {
    transform: translateX(4px);
    opacity: 0.6;
}

/* ── Segmented Control (pill, premium) ── */
.settings-segment {
    display: flex;
    background: var(--bg);
    border-radius: 100px;
    padding: 3px;
    gap: 2px;
}

.settings-segment-option {
    padding: 6px 14px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.settings-segment-option:hover {
    color: var(--text-primary);
}

.settings-segment-option.is-active {
    background: var(--bg-card);
    color: var(--teal);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0.5px 1px rgba(0, 0, 0, 0.03);
}

.settings-segment-option:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* ── Color Swatches (inline dots) ── */
.settings-swatches {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.settings-swatch:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-swatch.is-active {
    border-color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px currentColor;
}

.settings-swatch:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

/* ── Goal Input ── */
.settings-goal-area {
    padding: 0 18px 16px;
}

.settings-goal-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.settings-goal-input {
    flex: 1;
    height: 46px;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: box-shadow 0.22s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px transparent;
}

.settings-goal-input:focus {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 2px var(--teal);
}

.settings-goal-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.settings-goal-save {
    height: 46px;
    min-width: 46px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--teal);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.22s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 10px var(--teal-glow);
}

.settings-goal-save:hover {
    background: var(--teal-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--teal-glow);
}

.settings-goal-save:active {
    transform: translateY(0) scale(0.97);
}

.settings-goal-save:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.settings-goal-save svg {
    width: 16px;
    height: 16px;
}

.settings-goal-hint {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--green);
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-goal-hint.is-visible {
    opacity: 1;
}

/* ── Action Button ── */
.settings-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.18s ease;
    min-height: 56px;
}

.settings-action-btn:hover {
    background: var(--hover-bg);
}

.settings-action-btn:active {
    transform: scale(0.99);
}

.settings-action-btn:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: -2px;
    border-radius: 12px;
}

.settings-action-btn .settings-row-content {
    flex: 1;
}

.settings-action-btn .settings-chevron {
    flex-shrink: 0;
}

/* ── Info Note ── */
.settings-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 18px 14px;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    line-height: 1.55;
}

.settings-note svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--teal);
    opacity: 0.5;
}

/* ── PWA Hint ── */
.settings-pwa-hint {
    padding: 0 18px 14px;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    opacity: 0.6;
    line-height: 1.45;
}

/* ── Danger Zone ── */
.settings-card.settings-danger-card {
    box-shadow: 0 0 0 1px rgba(229, 62, 62, 0.15), 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .settings-card.settings-danger-card {
    box-shadow: 0 0 0 1px rgba(229, 62, 62, 0.12);
}

.settings-danger-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 12px;
}

.settings-danger-tag {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--red);
    background: var(--red-light);
    padding: 4px 10px;
    border-radius: 100px;
}

.settings-danger-divider {
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--border) 5%, var(--border) 95%, transparent 100%);
    margin: 0;
    opacity: 0.5;
}

.settings-danger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 18px;
    border: none;
    background: transparent;
    color: var(--red);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
}

.settings-danger-btn:hover {
    background: var(--red-light);
}

.settings-danger-btn:active {
    transform: scale(0.99);
}

.settings-danger-btn:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: -2px;
    border-radius: 12px;
}

.settings-danger-btn svg {
    width: 17px;
    height: 17px;
}

/* ── Color Schemes ── */
[data-color-scheme="blue"] {
    --teal: #0066CC; --teal-hover: #0052A3; --teal-light: #E6F2FF; --teal-glow: rgba(0, 102, 204, 0.15);
}

[data-theme="dark"][data-color-scheme="blue"] {
    --teal: #3399FF; --teal-hover: #5CADFF; --teal-light: rgba(51, 153, 255, 0.14); --teal-glow: rgba(51, 153, 255, 0.22);
}

[data-color-scheme="purple"] {
    --teal: #7C3AED; --teal-hover: #6D28D9; --teal-light: #F3E8FF; --teal-glow: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"][data-color-scheme="purple"] {
    --teal: #A78BFA; --teal-hover: #C4B5FD; --teal-light: rgba(167, 139, 250, 0.14); --teal-glow: rgba(167, 139, 250, 0.22);
}

[data-color-scheme="gold"] {
    --teal: #D97706; --teal-hover: #B45309; --teal-light: #FEF3C7; --teal-glow: rgba(217, 119, 6, 0.15);
}

[data-theme="dark"][data-color-scheme="gold"] {
    --teal: #FBBF24; --teal-hover: #FCD34D; --teal-light: rgba(251, 191, 36, 0.14); --teal-glow: rgba(251, 191, 36, 0.22);
}

[data-font-size="large"] {
    font-size: 17px;
}

[data-font-size="xlarge"] {
    font-size: 19px;
}
