/* ===============================
   SETTINGS CONTAINER
================================ */
.settings-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    margin-top: 32px;
}

/* ===============================
   SETTINGS SIDEBAR
================================ */
.settings-sidebar {
    position: sticky;
    top: 32px;
    height: fit-content;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 15px;
}

.settings-nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.settings-nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.settings-nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.settings-nav-item.active svg {
    opacity: 1;
}

/* ===============================
   SETTINGS CONTENT
================================ */
.settings-content {
    max-width: 700px;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-muted);
}

/* ===============================
   SETTINGS CARD
================================ */
.settings-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.settings-card > p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ===============================
   AVATAR UPLOAD
================================ */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 24px;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
    flex-shrink: 0;
}

.avatar-upload .help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===============================
   FORM GROUPS
================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: var(--surface);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===============================
   FORM MESSAGE
================================ */
.form-message {
    font-size: 0.9rem;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.form-message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.form-message.success {
    background: #d1fae5;
    color: #16a34a;
    border: 1px solid #a7f3d0;
}

/* ===============================
   PASSWORD WRAPPER
================================ */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding: 12px 14px;
    padding-right: 45px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s ease;
    font-family: inherit;
}

.password-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: var(--surface);
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--primary);
}

.toggle-password svg {
    display: block;
}

/* ===============================
   PASSWORD VALIDATION
================================ */
.password-validation {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-top: -8px;
    margin-bottom: 20px;
}

.validation-header {
    margin-bottom: 12px;
}

.validation-status {
    font-size: 13px;
    font-weight: 600;
}

.password-rules {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #dc2626;
    transition: all 0.2s ease;
}

.password-rules li svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.password-rules li[style*="none"] {
    color: #16a34a;
}

/* ===============================
   FORM ACTIONS
================================ */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===============================
   SETTING ITEM (Toggle)
================================ */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-child {
    padding-top: 0;
}

.setting-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===============================
   TOGGLE SWITCH
================================ */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e2e8f0;
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

/* Tema escuro - toggle slider */
[data-theme="dark"] .toggle-slider {
    background: #475569;
}

[data-theme="dark"] .toggle-slider:before {
    background: white;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ===============================
   THEME OPTIONS
================================ */
.theme-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.theme-option {
    position: relative;
    cursor: pointer;
}

.theme-option input {
    position: absolute;
    opacity: 0;
}

.theme-preview {
    height: 100px;
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.theme-preview.light {
    background: #ffffff !important;
}

.theme-preview.dark {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6e 50%, #1a2d47 100%);
}

.theme-preview.auto {
    background: linear-gradient(135deg, white 50%, #1a1a1a 50%);
}

.theme-option:hover .theme-preview {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.theme-option input:checked + .theme-preview {
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.theme-option span {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.theme-option.active span {
    color: var(--primary);
}

.theme-preview svg {
    color: var(--text);
}

.theme-preview.light svg {
    color: #111827 !important;
}

.theme-preview.dark svg {
    color: white;
}

/* ===============================
   DANGER ZONE
================================ */
.danger-zone {
    border-color: #fecaca;
    background: #fef2f2;
}

.danger-zone h3 {
    color: #dc2626;
}

.btn-danger {
    padding: 10px 18px;
    border-radius: 10px;
    background: #dc2626;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .settings-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .settings-sidebar {
        position: static;
    }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
    }

    .settings-nav-item {
        white-space: nowrap;
    }

    .settings-nav-item span {
        display: none;
    }

    .theme-options {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }
}