/* ==========================================================================
   My Profile — clean card layout (resources/views/filament/pages/my-profile.blade.php)
   Everything is scoped under .pv so it does not touch other pages.
   ========================================================================== */

.pv {
    --pv-brand: #2B337E;
    --pv-accent: #3267e3;
    --pv-text: #0f172a;
    --pv-muted: #64748b;
    --pv-line: #e6ecf5;
    --pv-card: #ffffff;
    --pv-soft: #f6f8fc;
    --pv-radius: 18px;
    --pv-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .05);

    display: grid;
    gap: 20px;
    color: var(--pv-text);
}

.dark .pv {
    --pv-text: #f1f5f9;
    --pv-muted: #94a3b8;
    --pv-line: rgba(148, 163, 184, .18);
    --pv-card: #111827;
    --pv-soft: #0f172a;
    --pv-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.pv svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---------- Hero ---------- */
.pv-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--pv-line);
    border-radius: 22px;
    background: var(--pv-card);
    box-shadow: var(--pv-shadow);
}

.pv-hero-banner {
    height: 118px;
    background:
        radial-gradient(circle at 12% 120%, rgba(255, 255, 255, .22) 0 60px, transparent 61px),
        radial-gradient(circle at 88% -30%, rgba(255, 255, 255, .16) 0 110px, transparent 111px),
        radial-gradient(circle at 70% 140%, rgba(126, 161, 255, .45) 0 90px, transparent 91px),
        linear-gradient(120deg, var(--pv-brand) 0%, #3b47a8 45%, var(--pv-accent) 100%);
}

.pv-hero-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
    margin-top: -56px;
    padding: 0 28px 22px;
}

.pv-avatar-wrap {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 8px;
}

.pv-avatar {
    position: relative;
    width: 128px;
    height: 128px;
    overflow: hidden;
    border: 5px solid var(--pv-card);
    border-radius: 32px;
    background: #eef2ff;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(43, 51, 126, .22);
}

.pv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pv-avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    transition: opacity .18s ease;
}

.pv-avatar-overlay svg { width: 22px; height: 22px; }
.pv-avatar:hover .pv-avatar-overlay,
.pv-avatar:focus-visible .pv-avatar-overlay,
.pv-avatar-overlay.is-busy { opacity: 1; }

.pv-camera {
    position: absolute;
    top: 96px;
    right: -4px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 3px solid var(--pv-card);
    border-radius: 999px;
    background: var(--pv-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(50, 103, 227, .35);
    transition: transform .16s ease;
}

.pv-camera:hover { transform: scale(1.08); }
.pv-camera svg { width: 16px; height: 16px; }

.pv-remove-photo {
    border: 0;
    background: none;
    color: #dc2626;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.pv-remove-photo:hover { text-decoration: underline; }

/* Only the avatar overlaps the banner; name and ring start just below it. */
.pv-identity { min-width: 0; padding-top: 70px; }
.pv-complete { margin-top: 70px; }

.pv-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pv-name-row h1 {
    margin: 0;
    color: var(--pv-text);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.15;
}

.pv-verified { color: var(--pv-accent); width: 22px !important; height: 22px !important; }

.pv-role {
    margin: 4px 0 12px;
    color: var(--pv-brand);
    font-size: 14px;
    font-weight: 800;
}

.dark .pv-role { color: #a5b4fc; }
.pv-role span { color: var(--pv-muted); margin: 0 4px; }

.pv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pv-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    border: 1px solid var(--pv-line);
    border-radius: 999px;
    background: var(--pv-soft);
    padding: 5px 11px;
    color: var(--pv-muted);
    font-size: 12.5px;
    font-weight: 700;
}

.pv-chips svg { width: 15px; height: 15px; }

.pv-photo-hint {
    margin: 10px 0 0;
    color: var(--pv-muted);
    font-size: 12px;
}

.pv-error {
    margin: 10px 0 0;
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
}

/* Completeness ring */
.pv-complete {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--pv-line);
    border-radius: 16px;
    background: var(--pv-soft);
    padding: 12px 16px 12px 12px;
}

.pv-ring {
    width: 64px !important;
    height: 64px !important;
    transform: rotate(-90deg);
}

.pv-ring circle { fill: none; stroke-width: 8; }
.pv-ring-track { stroke: var(--pv-line); }
.pv-ring-fill {
    stroke: var(--pv-accent);
    stroke-linecap: round;
    transition: stroke-dashoffset .6s ease;
}

.pv-complete-text { display: grid; gap: 1px; }
.pv-complete-text strong { color: var(--pv-text); font-size: 20px; font-weight: 900; line-height: 1.1; }
.pv-complete-text span { color: var(--pv-text); font-size: 12.5px; font-weight: 800; }
.pv-complete-text small { color: var(--pv-muted); font-size: 12px; }
.pv-complete-text small.is-done { color: #16a34a; font-weight: 700; }

/* Stats strip */
.pv-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--pv-line);
}

.pv-stats > div {
    display: grid;
    gap: 4px;
    padding: 14px 24px;
}

.pv-stats > div + div { border-left: 1px solid var(--pv-line); }

.pv-stats dt,
.pv-fact dt {
    color: var(--pv-muted);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pv-stats dd,
.pv-fact dd {
    margin: 0;
    color: var(--pv-text);
    font-size: 14.5px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pv-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: #eef2f7;
    padding: 3px 10px;
    color: var(--pv-muted);
    font-size: 12px;
    font-weight: 800;
}

.pv-pill.is-good { background: #dcfce7; color: #15803d; }
.pv-pill.is-bad { background: #fee2e2; color: #b91c1c; }
.pv-pill.is-warn { background: #fef3c7; color: #b45309; }

/* ---------- Tabs ---------- */
.pv-tabs {
    position: sticky;
    top: 4.5rem;
    z-index: 5;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border: 1px solid var(--pv-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--pv-card) 88%, transparent);
    padding: 5px;
    box-shadow: var(--pv-shadow);
    backdrop-filter: blur(8px);
    scrollbar-width: none;
}

.pv-tabs::-webkit-scrollbar { display: none; }

.pv-tabs a {
    display: inline-flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--pv-muted);
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}

.pv-tabs a:hover { background: var(--pv-soft); color: var(--pv-text); }

.pv-tabs a.is-active {
    background: var(--pv-brand);
    color: #fff;
    box-shadow: 0 6px 14px rgba(43, 51, 126, .25);
}

.pv-tabs svg { width: 17px; height: 17px; }

/* ---------- Grids ---------- */
.pv-grid { display: grid; gap: 20px; align-items: start; }
.pv-grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.pv-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pv-stack { display: grid; gap: 20px; }
.pv [data-pv-section] { scroll-margin-top: 9rem; }

/* ---------- Cards ---------- */
.pv-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--pv-line);
    border-radius: var(--pv-radius);
    background: var(--pv-card);
    box-shadow: var(--pv-shadow);
}

.pv-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 4px;
}

.pv-card-head > div { flex: 1 1 auto; min-width: 0; }

.pv-card-head h3 {
    margin: 0;
    color: var(--pv-text);
    font-size: 15.5px;
    font-weight: 900;
}

.pv-card-head p {
    margin: 2px 0 0;
    color: var(--pv-muted);
    font-size: 12.5px;
}

.pv-card-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

.pv-card-icon.is-blue { background: #eaf0ff; color: #3267e3; }
.pv-card-icon.is-violet { background: #f3edff; color: #7c3aed; }
.pv-card-icon.is-green { background: #e7f8ef; color: #16a34a; }
.pv-card-icon.is-amber { background: #fff4db; color: #d97706; }
.pv-card-icon.is-pink { background: #ffeef6; color: #db2777; }
.pv-card-icon.is-sky { background: #e6f5ff; color: #0284c7; }
.dark .pv-card-icon { background: rgba(148, 163, 184, .12); }

.pv-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: var(--pv-soft);
    padding: 4px 10px;
    color: var(--pv-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.pv-tag svg { width: 13px; height: 13px; }

.pv-card-body {
    display: grid;
    gap: 14px;
    padding: 14px 20px 20px;
}

.pv-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    border-top: 1px solid var(--pv-line);
    background: var(--pv-soft);
    padding: 12px 20px;
}

.pv-muted {
    margin: 0;
    color: var(--pv-muted);
    font-size: 13px;
    line-height: 1.55;
}

/* ---------- Fields ---------- */
.pv-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 16px 20px 20px;
}

.pv-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pv-span-full { grid-column: 1 / -1; }

.pv .profile-field label {
    color: var(--pv-muted) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.pv .profile-input,
.pv .profile-select,
.pv .profile-textarea {
    border-color: var(--pv-line) !important;
    border-radius: 11px !important;
    background-color: var(--pv-soft) !important;
    color: var(--pv-text) !important;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.pv .profile-input:focus,
.pv .profile-select:focus,
.pv .profile-textarea:focus {
    border-color: var(--pv-accent) !important;
    background-color: var(--pv-card) !important;
    box-shadow: 0 0 0 3px rgba(50, 103, 227, .14) !important;
}

/* Read-only facts */
.pv-facts {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 8px 20px 16px;
}

.pv-facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }

.pv-fact {
    display: grid;
    gap: 3px;
    border-bottom: 1px dashed var(--pv-line);
    padding: 11px 0;
}

.pv-fields .pv-fact { border: 1px solid var(--pv-line); border-radius: 11px; background: var(--pv-soft); padding: 9px 12px; }
.pv-facts .pv-fact:last-child { border-bottom: 0; }
.pv-fact dd.is-empty { color: var(--pv-muted); font-weight: 600; font-style: italic; }

.pv-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    margin: 14px 20px 20px;
    border: 1px dashed var(--pv-line);
    border-radius: 14px;
    background: var(--pv-soft);
    padding: 24px 18px;
    text-align: center;
}

.pv-empty svg { width: 32px; height: 32px; color: var(--pv-accent); }
.pv-empty strong { color: var(--pv-text); font-size: 14px; font-weight: 900; }
.pv-empty p { margin: 0; color: var(--pv-muted); font-size: 12.5px; line-height: 1.5; }

/* Sub forms inside Sign-in card */
.pv-subform { border-top: 1px solid var(--pv-line); margin-top: 14px; }
.pv-subform:first-of-type { border-top: 0; margin-top: 0; }

.pv-subform h4 {
    margin: 0;
    padding: 16px 20px 0;
    color: var(--pv-text);
    font-size: 13px;
    font-weight: 900;
}

.pv-subform .pv-fields { padding-bottom: 12px; }
.pv-subform-actions { display: flex; justify-content: flex-end; padding: 0 20px 18px; }

.pv-button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.pv-logout-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    border-top: 1px solid var(--pv-line);
    padding-top: 14px;
}

.pv-list {
    display: grid;
    gap: 2px;
    border: 1px solid var(--pv-line);
    border-radius: 12px;
    background: var(--pv-soft);
    padding: 6px 12px;
}

.pv-list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--pv-line);
    padding: 8px 0;
    color: var(--pv-text);
    font-size: 13px;
    font-weight: 700;
}

.pv-list-row:last-child { border-bottom: 0; }
.pv-list-row small { color: var(--pv-muted); font-size: 12px; }

.pv-link-btn {
    border: 0;
    background: none;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
}

.pv-2fa.is-on .pv-card-icon { background: #e7f8ef; color: #16a34a; }

/* Toggles */
.pv-toggles {
    display: grid;
    padding: 8px 20px 12px;
}

.pv .profile-toggle {
    border-width: 0 0 1px !important;
    border-color: var(--pv-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 13px 0 !important;
    color: var(--pv-text) !important;
}

.pv .profile-toggle:last-child { border-bottom: 0 !important; }

/* Timeline */
.pv-timeline {
    position: relative;
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 16px 20px 22px 44px;
    list-style: none;
}

.pv-timeline::before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 26px;
    left: 27px;
    width: 2px;
    background: var(--pv-line);
}

.pv-timeline li { position: relative; display: grid; gap: 2px; }

.pv-dot {
    position: absolute;
    top: 4px;
    left: -22px;
    width: 12px;
    height: 12px;
    border: 3px solid var(--pv-card);
    border-radius: 999px;
    background: var(--pv-accent);
    box-shadow: 0 0 0 2px rgba(50, 103, 227, .25);
}

.pv-timeline strong { color: var(--pv-text); font-size: 13.5px; font-weight: 800; }
.pv-timeline p { margin: 0; color: var(--pv-muted); font-size: 12.5px; }
.pv-timeline time { color: var(--pv-muted); font-size: 11.5px; font-weight: 700; }
.pv-timeline-empty { color: var(--pv-muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
    .pv-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pv-grid-3 > #activity-log { grid-column: 1 / -1; }
    .pv-fields-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
    .pv-grid-main,
    .pv-grid-2 { grid-template-columns: 1fr; }
    .pv-hero-body { grid-template-columns: auto minmax(0, 1fr); }
    .pv-complete { grid-column: 1 / -1; justify-self: start; margin-top: 0; }
    .pv-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pv-stats > div:nth-child(4) { border-left: 0; }
    .pv-stats > div:nth-child(n + 4) { border-top: 1px solid var(--pv-line); }
}

@media (max-width: 760px) {
    .pv { gap: 16px; }
    .pv-grid-3,
    .pv-fields,
    .pv-fields-3,
    .pv-facts-2,
    .pv-logout-form { grid-template-columns: 1fr; }
    .pv-hero-body {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
        padding: 0 16px 18px;
        text-align: center;
    }
    .pv-identity { padding-top: 0; }
    .pv-name-row, .pv-chips { justify-content: center; }
    .pv-complete { justify-self: stretch; }
    .pv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pv-stats > div { padding: 12px 16px; border-left: 0 !important; border-top: 1px solid var(--pv-line); }
    .pv-stats > div:nth-child(even) { border-left: 1px solid var(--pv-line) !important; }
    .pv-tabs { top: 4rem; }
    .pv-tabs a { flex: 0 0 auto; }
    .pv-card-head, .pv-fields, .pv-facts, .pv-toggles, .pv-card-body, .pv-card-foot { padding-left: 16px; padding-right: 16px; }
}
