/* ═══════════════════════════════════════════
   SETTINGS SECTION
   ═══════════════════════════════════════════ */

.settings-section {
    display: grid;
}
.settings-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

/* ── Grupo ── */
.settings-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-text-clr);
    margin-bottom: 10px;
    padding-left: 2px;
}

.settings-group-label i {
    font-size: 13px;
    color: var(--green-bright);
}

/* ── Card ── */
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Fila ── */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(169, 204, 187, 0.07);
    transition: background 150ms ease;
}

.settings-row:last-child { border-bottom: none; }
.settings-row:hover      { background: rgba(255, 255, 255, 0.025); }

.settings-row-danger:hover {
    background: rgba(255, 80, 80, 0.04);
}

.settings-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.settings-row-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-clr);
}

.settings-row-desc {
    font-size: 11.5px;
    color: var(--secondary-text-clr);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Toggle switch ── */
.toggle-switch {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-track {
    display: block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(169, 204, 187, 0.18);
    transition: background 200ms ease, border-color 200ms ease;
    position: relative;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(169, 204, 187, 0.5);
    transition: transform 200ms cubic-bezier(.4,0,.2,1), background 200ms ease;
}

.toggle-switch input:checked + .toggle-track {
    background: linear-gradient(135deg, #0f7a55, #1fa36f 50%, #18bf72);
    border-color: transparent;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
    transform: translateX(18px);
    background: #fff;
}

/* ── Badge ── */
.settings-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(61, 220, 151, 0.1);
    color: #7affc5;
    border: 1px solid rgba(61, 220, 151, 0.18);
    white-space: nowrap;
}

.badge-xp {
    background: rgba(255, 185, 50, 0.1);
    color: #ffd080;
    border-color: rgba(255, 185, 50, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ── Action button ── */
.settings-action-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(169, 204, 187, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-clr);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    white-space: nowrap;
}

.settings-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-clr);
}

.settings-action-btn.danger {
    border-color: rgba(255, 80, 80, 0.2);
    background: rgba(255, 80, 80, 0.06);
    color: #ff9090;
}

.settings-action-btn.danger:hover {
    background: rgba(255, 80, 80, 0.14);
}

/* ── Logout ── */
.settings-logout-btn {
    width: 100%;
    padding: 13px;
    border-radius: var(--r-lg);
    border: 1px solid rgba(255, 80, 80, 0.2);
    background: rgba(255, 80, 80, 0.06);
    color: #ff9090;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 160ms ease, transform 120ms ease;
    margin-bottom: 1.5rem;
}

.settings-logout-btn:hover {
    background: rgba(255, 80, 80, 0.14);
    transform: translateY(-1px);
}

.settings-logout-btn:active {
    transform: translateY(0);
}

/* ── Versión ── */
.settings-version {
    text-align: center;
    font-size: 11.5px;
    color: rgba(169, 204, 187, 0.25);
    padding-bottom: 1rem;
}

/* ── Reduced motion ── */
html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

/* ── Mobile ── */
@media (max-width: 800px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .settings-row { padding: 12px 14px; }
}