/* ── Profile Hero ─────────────────────────────────────────────── */
.profile-hero {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.profile-hero__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-hero__avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800; color: #fff;
  overflow: hidden;
  border: 4px solid var(--primary-light);
}
.profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-btn {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  transition: background var(--transition);
}
.avatar-upload-btn:hover { background: var(--primary-dark); }

.profile-hero__info { flex: 1; min-width: 0; }
.profile-hero__info h2 { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.profile-hero__email { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 12px; }
.profile-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Profile Grid ─────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Profile Section ──────────────────────────────────────────── */
.profile-section {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-section--sub { grid-column: 1; }

.profile-section__header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.profile-section__header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.profile-section__header p  { font-size: 0.82rem; color: var(--gray-400); margin-top: 2px; }

/* ── Profile Form ─────────────────────────────────────────────── */
.profile-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.pf-group { display: flex; flex-direction: column; gap: 5px; }

.pf-label { font-size: 0.83rem; font-weight: 600; color: var(--gray-700); }
.req { color: var(--danger); }

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

.pf-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--gray-800);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.pf-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.pf-input:disabled { background: var(--gray-50); color: var(--gray-400); cursor: not-allowed; }
.pf-input.pf-error-state { border-color: var(--danger); }

.pf-input-wrap .pf-input { padding-right: 40px; }

.pw-toggle {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); display: flex; align-items: center;
  padding: 4px;
}
.pw-toggle:hover { color: var(--gray-600); }

.pf-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.pf-hint { font-size: 0.75rem; color: var(--gray-400); }
.pf-error { font-size: 0.78rem; color: var(--danger); min-height: 16px; }

.pf-error-box {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
}

.pf-actions { display: flex; justify-content: flex-end; padding-top: 4px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition);
  font-family: var(--font);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; pointer-events: none; }
.btn-spin { animation: spin .7s linear infinite; }

/* ── Subscription Card ────────────────────────────────────────── */
.sub-card {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header row */
.sub-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}
.sub-card__icon { font-size: 1.8rem; flex-shrink: 0; }
.sub-card__title { flex: 1; min-width: 0; }
.sub-card__title strong { display: block; font-size: 1rem; font-weight: 700; color: var(--primary-dark); }
.sub-card__title p { font-size: 0.82rem; color: var(--primary); margin-top: 2px; }

/* Status badge chip */
.sub-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.sub-status-badge--active  { background: #dcfce7; color: #15803d; }
.sub-status-badge--trial   { background: #fef3c7; color: #92400e; }
.sub-status-badge--expired { background: #fee2e2; color: #991b1b; }
.sub-status-badge--free    { background: var(--gray-100); color: var(--gray-500); }

/* Date row */
.sub-card__dates {
  display: flex;
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sub-date-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
}
.sub-date-divider { width: 1px; background: var(--gray-100); flex-shrink: 0; }
.sub-date-label {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sub-date-value { font-size: 0.88rem; font-weight: 700; color: var(--gray-800); }

/* Progress bar */
.sub-progress-wrap { display: flex; flex-direction: column; gap: 8px; }
.sub-progress-header { display: flex; justify-content: space-between; align-items: center; }
.sub-progress-label { font-size: 0.78rem; color: var(--gray-500); font-weight: 500; }
.sub-days-count { font-size: 0.78rem; font-weight: 700; color: var(--gray-700); }
.sub-progress-track {
  height: 8px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
}
.sub-progress-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  background: #22c55e;
  transition: width 0.6s cubic-bezier(.4,0,.2,1), background 0.3s ease;
}
.sub-progress-fill.bar--green  { background: #22c55e; }
.sub-progress-fill.bar--yellow { background: #f59e0b; }
.sub-progress-fill.bar--red    { background: #ef4444; }

/* Upgrade CTA */
.btn-upgrade-full {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  display: block;
  transition: opacity var(--transition);
}
.btn-upgrade-full:hover { opacity: .88; }

/* ── Account Stats ────────────────────────────────────────────── */
.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 20px 24px;
  gap: 0;
}
.acc-stat {
  text-align: center;
  padding: 12px 8px;
  border-right: 1px solid var(--gray-100);
}
.acc-stat:last-child { border-right: none; }
.acc-stat__value { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.acc-stat__label { font-size: 0.75rem; color: var(--gray-400); margin-top: 4px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-section--sub { grid-column: auto; }
  .account-stats { grid-template-columns: repeat(2, 1fr); }
  .acc-stat:nth-child(2) { border-right: none; }
}
@media (max-width: 600px) {
  .profile-hero { flex-direction: column; align-items: center; text-align: center; }
  .profile-hero__chips { justify-content: center; }
  .pf-row { grid-template-columns: 1fr; }
}

/* ── Nav lock (education not set) ── */
.nav-edu-locked .sidebar__nav .nav-item[href]:not([href="/profile"]) { opacity:.35; filter:blur(1.5px); cursor:not-allowed; }
