﻿/* ═══════════════════════════════════════════════════════════
   Premium Profile Page - Editorial & Refined
   ═══════════════════════════════════════════════════════════ */

:root {
  --nero:       #0f0f0f;
  --nero-2:     #1a1a1a;
  --charcoal:   #2d2d2d;
  --smoke:      #6a6a6a;
  --smoke-2:    #8f8f8f;
  --ash:        #b5b5b5;
  --cloud:      #e3e3e3;
  --snow:       #f7f7f7;
  --white:      #ffffff;
  
  --accent:     #0067b8;
  --accent-dk:  #004c8a;
  --accent-lt:  #e8f3fc;
  
  --red:        #d32f2f;
  --red-lt:     #ffebee;
  --green:      #2e7d32;
  --green-lt:   #e8f5e9;
  
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-xl: 32px;
  
  --shadow-sm:  0 2px 12px rgba(0,0,0,.04), 0 1px 4px rgba(0,0,0,.02);
  --shadow-md:  0 4px 24px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.03);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ─────────────────────────────────────────────────────────
   Reset
───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overscroll-behavior: none; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--nero);
  background: var(--snow);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(0,103,184,.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,103,184,.015) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,.008) 2px,
      rgba(0,0,0,.008) 4px
    );
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  position: relative;
}
img    { display: block; max-width: 100%; }
a      { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─────────────────────────────────────────────────────────
   Background Shapes (organic, subtle depth)
───────────────────────────────────────────────────────── */
.prof-bg-shapes {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.prof-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .3;
  animation: float 20s ease-in-out infinite;
}
.prof-shape-1 {
  top: -10%; right: -5%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,103,184,.15), transparent 70%);
  animation-delay: 0s;
}
.prof-shape-2 {
  bottom: -15%; left: -8%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,103,184,.1), transparent 70%);
  animation-delay: 10s;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px, -30px) scale(1.05); }
  66%      { transform: translate(-20px, 20px) scale(.95); }
}

/* ─────────────────────────────────────────────────────────
   Header
───────────────────────────────────────────────────────── */
.prof-header {
  position: sticky; top: 0; z-index: 100;
  height: 66px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.prof-header-inner {
  max-width: 1040px; margin: 0 auto;
  padding: 0 32px; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.prof-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800;
  letter-spacing: -.02em;
  transition: opacity .2s;
}
.prof-brand:hover { opacity: .7; }
.prof-brand img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.15);
}
.prof-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  font-size: 14.5px; font-weight: 600; color: var(--smoke);
  border: 1px solid var(--cloud);
  border-radius: var(--r-sm);
  background: var(--white);
  transition: all .2s var(--ease);
}
.prof-back svg { width: 15px; height: 15px; transition: transform .2s; }
.prof-back:hover { border-color: var(--ash); color: var(--nero-2); }
.prof-back:hover svg { transform: translateX(-2px); }

/* ─────────────────────────────────────────────────────────
   Page
───────────────────────────────────────────────────────── */
.prof-page {
  position: relative; z-index: 1;
  max-width: 1040px; margin: 0 auto;
  padding: 56px 32px 100px;
}

/* ─────────────────────────────────────────────────────────
   Hero (large centered avatar + name)
───────────────────────────────────────────────────────── */
.prof-hero {
  text-align: center;
  margin-bottom: 64px;
  animation: fadeUp .6s var(--ease);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.prof-hero-avatar {
  width: 120px; height: 120px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dk) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.75rem; font-weight: 800; color: var(--white);
  letter-spacing: -.03em;
  box-shadow: 0 8px 32px rgba(0,103,184,.22), 0 2px 8px rgba(0,0,0,.04);
  position: relative;
}
.prof-hero-avatar::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.3) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.1) 0%, transparent 60%);
  pointer-events: none;
}
.prof-hero-avatar::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0,103,184,.15);
}
.prof-hero-name {
  font-size: 2.25rem; font-weight: 800;
  letter-spacing: -.04em; color: var(--nero);
  line-height: 1.1; margin-bottom: 8px;
}
.prof-hero-role {
  font-size: .95rem; font-weight: 500;
  color: var(--smoke); letter-spacing: .02em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────
   Content (single column, stacked cards)
───────────────────────────────────────────────────────── */
.prof-content {
  display: flex; flex-direction: column; gap: 24px;
  max-width: 720px; margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────
   Card
───────────────────────────────────────────────────────── */
.prof-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
  animation: cardIn .5s var(--ease) backwards;
  position: relative;
  overflow: hidden;
}
.prof-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,103,184,.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: transform .6s var(--ease);
}
.prof-card:hover::before {
  transform: translate(-20px, 20px) scale(1.1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.prof-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.prof-card-account { animation-delay: .1s; }
.prof-card-security { animation-delay: .2s; }

/* Card label */
.prof-card-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--smoke); margin-bottom: 28px;
  position: relative;
  padding-left: 16px;
}
.prof-card-label::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dk));
  border-radius: 2px;
}

/* Card header (with icon) */
.prof-card-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 32px;
}
.prof-card-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--accent-lt);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}
.prof-card-icon svg { width: 22px; height: 22px; stroke: var(--accent); }
.prof-card-title {
  font-size: 1.3rem; font-weight: 700;
  color: var(--nero); letter-spacing: -.02em; line-height: 1.2;
}
.prof-card-subtitle {
  font-size: .88rem; color: var(--smoke);
  margin-top: 4px; font-weight: 500;
}

/* ─────────────────────────────────────────────────────────
   Info Grid (3-column layout for account details)
───────────────────────────────────────────────────────── */
.prof-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.prof-info-item {
  display: flex; flex-direction: column; gap: 8px;
}
.prof-info-label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--smoke-2);
}
.prof-info-value {
  font-size: .95rem; font-weight: 600;
  color: var(--nero);
  padding: 12px 16px;
  background: var(--snow);
  border: 1px solid rgba(0,0,0,.04);
  border-radius: var(--r-md);
  word-break: break-word;
}
.prof-info-email { font-weight: 500; }
.prof-info-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--accent-lt) 0%, rgba(0,103,184,.08) 100%);
  color: var(--accent-dk);
  border: 1px solid rgba(0,103,184,.12);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
  letter-spacing: .02em;
}

/* ─────────────────────────────────────────────────────────
   Sessions Card (link)
───────────────────────────────────────────────────────── */
.prof-sessions-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--snow);
  border: 1px solid rgba(0,0,0,.05);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all .25s var(--ease);
}
.prof-sessions-card:hover {
  background: rgba(0,103,184,.03);
  border-color: rgba(0,103,184,.2);
  transform: translateX(4px);
}
.prof-sessions-left { display: flex; align-items: center; gap: 16px; }
.prof-sessions-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--white);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  transition: all .25s var(--ease);
}
.prof-sessions-icon svg { width: 19px; height: 19px; stroke: var(--charcoal); transition: stroke .25s; }
.prof-sessions-card:hover .prof-sessions-icon {
  background: var(--accent-lt);
  border-color: var(--accent);
}
.prof-sessions-card:hover .prof-sessions-icon svg { stroke: var(--accent); }
.prof-sessions-title {
  font-size: .95rem; font-weight: 700; color: var(--nero);
}
.prof-sessions-desc {
  font-size: .82rem; color: var(--smoke);
  font-weight: 500; margin-top: 2px;
}
.prof-sessions-arrow {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: var(--ash);
  transition: stroke .25s, transform .25s;
}
.prof-sessions-card:hover .prof-sessions-arrow {
  stroke: var(--accent);
  transform: translateX(4px);
}

/* ─────────────────────────────────────────────────────────
   Form (password inputs)
───────────────────────────────────────────────────────── */
.prof-form {
  display: flex; flex-direction: column; gap: 20px;
}
.prof-input-group {
  display: flex; flex-direction: column; gap: 8px;
}
.prof-label {
  font-size: 13px; font-weight: 700;
  letter-spacing: .01em; color: var(--nero-2);
}
.prof-input-wrap { position: relative; }
.prof-input {
  width: 100%; padding: 13px 44px 13px 16px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,.1);
  border-radius: var(--r-md);
  font-family: inherit; font-size: 15px; color: var(--nero);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.prof-input::placeholder { color: var(--ash); }
.prof-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,103,184,.08);
}
.prof-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(211,47,47,.06);
}

/* Eye toggle */
.prof-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--smoke);
  border-radius: var(--r-sm);
  transition: color .2s, background .2s;
}
.prof-eye:hover { color: var(--nero); background: rgba(0,0,0,.04); }
.prof-eye svg { width: 17px; height: 17px; }

/* Password strength */
.pwd-strength {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.pwd-strength-bar {
  flex: 1; height: 5px;
  background: rgba(0,0,0,.06);
  border-radius: 999px;
  overflow: hidden;
}
.pwd-strength-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  transition: width .3s var(--ease), background .3s;
}
.pwd-strength-label {
  font-size: 12px; font-weight: 700;
  letter-spacing: .02em; min-width: 52px;
}

/* Update button */
.prof-btn-update {
  width: 100%; padding: 14px 28px; margin-top: 8px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  color: var(--white);
  background: var(--nero);
  border-radius: var(--r-md);
  transition: background .2s, transform .15s, box-shadow .2s;
}
.prof-btn-update:hover:not(:disabled) {
  background: var(--nero-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.16);
}
.prof-btn-update:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Spinner */
.pwd-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────
   Inline Message
───────────────────────────────────────────────────────── */
.prof-msg {
  display: none;
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; border: 1px solid;
  animation: msgIn .25s var(--ease);
}
@keyframes msgIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.prof-msg.error   { background: var(--red-lt);   color: var(--red);   border-color: rgba(211,47,47,.2); display: block; }
.prof-msg.success { background: var(--green-lt); color: var(--green); border-color: rgba(46,125,50,.2); display: block; }

/* ─────────────────────────────────────────────────────────
   Toast
───────────────────────────────────────────────────────── */
.prof-toast {
  position: fixed; bottom: 32px; right: 32px; z-index: 999;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: var(--nero); color: var(--white);
  border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px); opacity: 0;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  pointer-events: none;
}
.prof-toast.show { transform: translateY(0); opacity: 1; }
.prof-toast.error-toast  { background: var(--red); }
.prof-toast.success-toast { background: var(--nero); }
.prof-toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .prof-page { padding: 40px 20px 80px; }
  .prof-header-inner { padding: 0 20px; height: 64px; }
  .prof-hero { margin-bottom: 48px; }
  .prof-hero-avatar { width: 96px; height: 96px; font-size: 2.2rem; }
  .prof-hero-name { font-size: 1.75rem; }
  .prof-card { padding: 28px 24px; }
  .prof-info-grid { grid-template-columns: 1fr; gap: 16px; }
  .prof-shape { display: none; }
}


/* ═══════════════════════════════════════════════════════════
   PROFILE SKELETON LOADER
═══════════════════════════════════════════════════════════ */

@keyframes psk-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.psk-box {
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 600px 100%;
  animation: psk-shimmer 1.4s ease-in-out infinite;
  display: block;
}

.psk-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--snow);
  overflow-y: auto;
  overscroll-behavior: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.psk-overlay.psk-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.psk-header {
  height: 66px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex;
  align-items: center;
}
.psk-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.psk-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.psk-hero {
  text-align: center;
  margin-bottom: 40px;
}

.psk-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

/* Hide real page until skeleton gone */
.prof-page {
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease;
}
.prof-page.prof-ready {
  visibility: visible;
  opacity: 1;
}

/* Background + overscroll fixes */
html { background: var(--snow); }
.prof-header {
  position: relative; /* needed for ::before */
}
.prof-header::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  height: 200px;
  background: #fff;
  pointer-events: none;
}

@media (max-width: 768px) {
  .psk-page { padding: 40px 20px 80px; }
  .psk-header-inner { padding: 0 20px; }
  .psk-card { padding: 28px 24px; }
  .psk-card > div[style*="grid"] { grid-template-columns: 1fr !important; }
}
