/* ── Luxa Users — Base Styles ─────────────────────────────────
   All colors go through CSS variables so themes just override them.
   ──────────────────────────────────────────────────────────── */

/* ── Hidden attribute — highest specificity fix ─────────────── */
.lu-wrap [hidden] { display: none !important; }


/* Default variable set (overridden per theme) */
.lu-wrap {
    --lu-primary:      #6366f1;
    --lu-primary-h:    #4f46e5;
    --lu-primary-rgb:  99, 102, 241;
    --lu-bg:           #ffffff;
    --lu-surface:      #f8fafc;
    --lu-border:       #e2e8f0;
    --lu-text:         #0f172a;
    --lu-muted:        #64748b;
    --lu-radius:       12px;
    --lu-shadow:       0 4px 24px rgba(0,0,0,.08);
    --lu-input-bg:     #f8fafc;
    --lu-input-focus:  rgba(var(--lu-primary-rgb), .15);
    --lu-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lu-transition:   .18s ease;
}

/* ── Layout ──────────────────────────────────────────────────── */
.lu-wrap {
    font-family: var(--lu-font);
    color: var(--lu-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.lu-card {
    background: var(--lu-bg);
    border-radius: var(--lu-radius);
    box-shadow: var(--lu-shadow);
    padding: 40px;
    max-width: 440px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Profile uses wider layout */
.lu-wrap-profile .lu-card {
    max-width: 900px;
    padding: 0;
    overflow: visible;
}

/* ── Card header ─────────────────────────────────────────────── */
.lu-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.lu-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--lu-text);
    margin: 0 0 6px;
}

.lu-subtitle {
    font-size: 14px;
    color: var(--lu-muted);
    margin: 0;
}

.lu-icon-circle {
    font-size: 36px;
    margin-bottom: 12px;
}

/* ── Notices / Alerts ────────────────────────────────────────── */
.lu-notices { margin-bottom: 16px; }

.lu-notice {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: lu-slide-down .2s ease;
}

.lu-notice-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.lu-notice-error   { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.lu-notice-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.lu-alert {
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.lu-alert svg { flex-shrink: 0; margin-top: 2px; }
.lu-alert p { margin: 4px 0 10px; font-size: 13px; }
.lu-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Form fields ─────────────────────────────────────────────── */
.lu-form { display: flex; flex-direction: column; gap: 0; }

.lu-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lu-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--lu-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lu-label-link {
    font-weight: 500;
    color: var(--lu-primary);
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}
.lu-label-link:hover { text-decoration: underline; }

.lu-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.lu-icon {
    position: absolute;
    left: 13px;
    color: var(--lu-muted);
    display: flex;
    pointer-events: none;
    z-index: 1;
}

.lu-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--lu-border);
    border-radius: 8px;
    background: var(--lu-input-bg);
    font-size: 14px;
    color: var(--lu-text);
    font-family: var(--lu-font);
    transition: border-color var(--lu-transition), box-shadow var(--lu-transition);
    box-sizing: border-box;
}

.lu-input:focus {
    outline: none;
    border-color: var(--lu-primary);
    box-shadow: 0 0 0 3px var(--lu-input-focus);
    background: #fff;
}

/* Input without icon */
.lu-field > .lu-input,
.lu-field .lu-input:not([class*="lu-input-wrap"] .lu-input) {
    padding-left: 14px;
}
/* Always left-pad when icon present via parent */
.lu-input-wrap .lu-input { padding-left: 40px; }

.lu-input:disabled {
    background: var(--lu-surface);
    color: var(--lu-muted);
    cursor: not-allowed;
}

.lu-textarea { resize: vertical; min-height: 90px; }

.lu-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--lu-muted);
    padding: 4px;
    display: flex;
    transition: color var(--lu-transition);
}
.lu-toggle-pw:hover { color: var(--lu-text); }

.lu-field-note {
    font-size: 12px;
    color: var(--lu-muted);
}

/* ── Password strength ────────────────────────────────────────── */
.lu-strength-bar {
    height: 3px;
    background: var(--lu-border);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 4px;
}
.lu-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width .35s ease, background .35s ease;
}
.lu-strength-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--lu-muted);
}

/* ── Checkbox ────────────────────────────────────────────────── */
.lu-field-row { flex-direction: row; align-items: center; }

.lu-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--lu-muted);
}
.lu-checkbox input { accent-color: var(--lu-primary); width: 15px; height: 15px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.lu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--lu-font);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--lu-transition);
    text-decoration: none;
    white-space: nowrap;
}

.lu-btn-primary {
    background: var(--lu-primary);
    color: #fff;
    border-color: var(--lu-primary);
}
.lu-btn-primary:hover {
    background: var(--lu-primary-h);
    border-color: var(--lu-primary-h);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--lu-primary-rgb), .35);
    color: #fff;
}

.lu-btn-outline {
    background: transparent;
    color: var(--lu-primary);
    border-color: var(--lu-primary);
}
.lu-btn-outline:hover {
    background: rgba(var(--lu-primary-rgb), .06);
    color: var(--lu-primary);
}

.lu-btn-ghost {
    background: transparent;
    color: var(--lu-muted);
    border-color: var(--lu-border);
}
.lu-btn-ghost:hover {
    background: var(--lu-surface);
    color: var(--lu-text);
}

.lu-btn-warning {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
    font-size: 13px;
}
.lu-btn-warning:hover { background: #d97706; }

.lu-btn-sm { padding: 7px 14px; font-size: 13px; }
.lu-btn-full { width: 100%; margin-top: 4px; }

.lu-btn-loading { display: flex; align-items: center; gap: 8px; }

.lu-btn[disabled] {
    opacity: .65;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Spinner */
.lu-spinner {
    width: 16px; height: 16px;
    animation: lu-spin 1s linear infinite;
}
.lu-spinner circle {
    animation: lu-dash 1.5s ease-in-out infinite;
    stroke: currentColor;
}

/* ── Switch text ─────────────────────────────────────────────── */
.lu-switch-text {
    text-align: center;
    font-size: 13px;
    color: var(--lu-muted);
    margin: 16px 0 0;
}
.lu-switch-text a {
    color: var(--lu-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.lu-switch-text a:hover { text-decoration: underline; }

.lu-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Profile layout ──────────────────────────────────────────── */
.lu-profile-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    background: var(--lu-bg);
    border-radius: var(--lu-radius);
    box-shadow: var(--lu-shadow);
    overflow: hidden;
    min-height: 500px;
}

.lu-profile-sidebar {
    background: var(--lu-surface);
    border-right: 1px solid var(--lu-border);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.lu-avatar-wrap {
    position: relative;
    margin-bottom: 8px;
}
.lu-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--lu-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.lu-avatar-edit {
    position: absolute;
    bottom: 0; right: 0;
    background: var(--lu-primary);
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    transition: transform var(--lu-transition);
}
.lu-avatar-edit:hover { transform: scale(1.1); }

.lu-profile-name { font-weight: 700; font-size: 15px; text-align: center; }
.lu-profile-username { font-size: 12px; color: var(--lu-muted); }

.lu-status-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 99px;
    margin: 4px 0 16px;
}

.lu-profile-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.lu-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--lu-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--lu-transition);
}
.lu-nav-item:hover { background: var(--lu-bg); color: var(--lu-text); }
.lu-nav-item.active { background: var(--lu-bg); color: var(--lu-primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

.lu-logout-btn {
    width: 100%;
    margin-top: 8px;
    font-size: 13px;
}

/* ── Profile main ────────────────────────────────────────────── */
.lu-profile-main { padding: 32px 36px; }

.lu-section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--lu-border);
}
.lu-section-header h3 { margin: 0; font-size: 17px; font-weight: 700; }

.lu-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

/* Activity */
.lu-activity-list { display: flex; flex-direction: column; gap: 10px; }
.lu-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--lu-surface);
    border-radius: 8px;
}
.lu-activity-icon { font-size: 20px; }
.lu-activity-body { display: flex; flex-direction: column; }
.lu-activity-action { font-size: 14px; font-weight: 600; }
.lu-activity-meta { font-size: 12px; color: var(--lu-muted); }
.lu-empty { color: var(--lu-muted); font-size: 14px; text-align: center; padding: 24px 0; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes lu-spin  { to { transform: rotate(360deg); } }
@keyframes lu-dash  { 0% { stroke-dashoffset: 31.4; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -31.4; } }
@keyframes lu-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes lu-fade-in    { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
    .lu-card { padding: 28px 20px; }

    .lu-profile-layout { grid-template-columns: 1fr; }
    .lu-profile-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--lu-border);
        padding: 20px;
        gap: 12px;
    }
    .lu-avatar-wrap { margin-bottom: 0; }
    .lu-profile-nav { flex-direction: row; }
    .lu-logout-btn { width: auto; margin-top: 0; }
    .lu-profile-main { padding: 24px 20px; }
    .lu-form-grid { grid-template-columns: 1fr; }
}
