/* Patient profile — Speech Sathi */

:root {
  --pp-bg: #fff9f9;
  --pp-sidebar: #fff3f3;
  --pp-card: #ffffff;
  --pp-text: #271716;
  --pp-muted: #6b5c59;
  --pp-accent: #b22222;
  --pp-accent-soft: #fdecec;
  --pp-input-bg: #fdf2f2;
  --pp-border: #f0dede;
  --pp-blue-badge: #dbeafe;
  --pp-blue-badge-text: #1d4ed8;
  --pp-orange-badge: #ffedd5;
  --pp-orange-badge-text: #c2410c;
  --pp-radius: 14px;
  --pp-radius-lg: 16px;
}

body.patient-profile {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--pp-text);
  background: var(--pp-bg);
}

body.patient-profile a {
  text-decoration: none;
  color: inherit;
}

.pp-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.pp-sidebar {
  background: var(--pp-sidebar);
  border-right: 1px solid var(--pp-border);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pp-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.pp-portal-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #8a7a78;
  text-align: center;
  margin-bottom: 22px;
}

.pp-brand img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.pp-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.pp-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #5c4c4a;
  border-left: 4px solid transparent;
}

.pp-nav a:hover {
  background: rgba(255, 255, 255, 0.75);
}

.pp-nav a.active {
  background: #ffe8e8;
  color: var(--pp-accent);
  border-left-color: var(--pp-accent);
}

.pp-nav svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.pp-sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-phase-card {
  background: #fff;
  border-radius: var(--pp-radius);
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pp-muted);
  border: 1px solid var(--pp-border);
  box-shadow: 0 4px 14px rgba(39, 23, 22, 0.04);
}

.pp-phase-card strong {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--pp-text);
}

.pp-btn-practice {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #9c1c2e, #c41e3a);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(178, 34, 34, 0.22);
}

.pp-btn-practice:hover {
  filter: brightness(1.03);
}

.pp-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pp-muted);
}

.pp-logout:hover {
  color: var(--pp-accent);
}

/* Main */
.pp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pp-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--pp-border);
  background: rgba(255, 252, 252, 0.96);
}

.pp-topbar-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pp-accent);
}

.pp-topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.pp-topbar-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pp-muted);
}

.pp-topbar-links a:hover {
  color: var(--pp-text);
}

.pp-topbar-spacer {
  flex: 1;
  min-width: 8px;
}

.pp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pp-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #edd5d5;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #5c4c4a;
  padding: 0;
}

.pp-top-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.pp-content {
  padding: 24px 28px 40px;
  flex: 1;
}

/* Hero profile card */
.pp-hero-card {
  background: var(--pp-card);
  border-radius: var(--pp-radius-lg);
  padding: 24px 28px;
  box-shadow: 0 8px 28px rgba(39, 23, 22, 0.07);
  border: 1px solid #f5ebe9;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.pp-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.pp-avatar-wrap img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.pp-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--pp-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(178, 34, 34, 0.35);
}

.pp-avatar-edit svg {
  width: 14px;
  height: 14px;
}

.pp-hero-info {
  flex: 1;
  min-width: 200px;
}

.pp-hero-info h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
}

.pp-hero-meta {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--pp-muted);
}

.pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

.pp-badge-premium {
  background: var(--pp-blue-badge);
  color: var(--pp-blue-badge-text);
}

.pp-badge-journey {
  background: var(--pp-orange-badge);
  color: var(--pp-orange-badge-text);
}

.pp-btn-save {
  margin-left: auto;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #9c1c2e, #c41e3a);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(178, 34, 34, 0.2);
}

.pp-btn-save:hover {
  filter: brightness(1.03);
}

/* Two-column grid */
.pp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pp-card {
  background: var(--pp-card);
  border-radius: var(--pp-radius-lg);
  padding: 22px 24px;
  box-shadow: 0 8px 28px rgba(39, 23, 22, 0.06);
  border: 1px solid #f5ebe9;
}

.pp-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 800;
}

.pp-card-title svg {
  width: 22px;
  height: 22px;
  color: var(--pp-accent);
  flex-shrink: 0;
}

.pp-field {
  margin-bottom: 16px;
}

.pp-field:last-child {
  margin-bottom: 0;
}

.pp-subheading {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pp-muted);
}

.pp-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pp-muted);
  margin-bottom: 6px;
}

.pp-field input,
.pp-field textarea {
  width: 100%;
  border: 1px solid #edd5d5;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.92rem;
  background: var(--pp-input-bg);
  color: var(--pp-text);
}

.pp-field textarea {
  min-height: 88px;
  resize: vertical;
}

.pp-link-action {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pp-accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Linked accounts */
.pp-linked-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f5efee;
}

.pp-linked-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pp-linked-row:first-of-type {
  padding-top: 0;
}

.pp-linked-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.pp-linked-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.pp-badge-connected {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--pp-accent-soft);
  color: var(--pp-accent);
}

.pp-connect-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pp-accent);
}

/* Voice toggles */
.pp-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.pp-voice-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid #edd5d5;
  background: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pp-muted);
  cursor: pointer;
}

.pp-voice-btn.active {
  border-color: var(--pp-accent);
  color: var(--pp-accent);
  background: #fff5f5;
}

/* Security rows */
.pp-security-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--pp-input-bg);
  border: 1px solid #f5e4e4;
  margin-bottom: 10px;
  color: inherit;
}

a.pp-security-row {
  cursor: pointer;
}

a.pp-security-row:hover {
  border-color: #e8d0d0;
  background: #fff8f8;
}

.pp-security-row--static {
  cursor: default;
}

.pp-security-row:last-child {
  margin-bottom: 0;
}

.pp-security-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--pp-accent);
}

.pp-security-icon svg {
  width: 20px;
  height: 20px;
}

.pp-security-body {
  flex: 1;
  min-width: 0;
}

.pp-security-body strong {
  display: block;
  font-size: 0.92rem;
}

.pp-security-body span {
  font-size: 0.8rem;
  color: var(--pp-muted);
}

.pp-chevron {
  color: #b8a8a6;
  font-size: 1.1rem;
  font-weight: 300;
}

/* Toggle switch */
.pp-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.pp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pp-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d4c4c2;
  cursor: pointer;
  transition: background 0.2s;
}

.pp-switch-slider::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.pp-switch input:checked + .pp-switch-slider {
  background: var(--pp-accent);
}

.pp-switch input:checked + .pp-switch-slider::after {
  transform: translateX(22px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1024px) {
  .pp-grid {
    grid-template-columns: 1fr;
  }

  .pp-hero-card .pp-btn-save {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .pp-shell {
    grid-template-columns: 1fr;
  }

  .pp-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--pp-border);
  }

  .pp-portal-label {
    width: 100%;
  }

  .pp-brand {
    width: 100%;
  }

  .pp-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .pp-sidebar-bottom {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .pp-phase-card {
    flex: 1;
    min-width: 160px;
  }

  .pp-btn-practice {
    width: auto;
    flex: 1;
    min-width: 180px;
  }
}

@media (max-width: 640px) {
  .pp-topbar {
    padding: 14px 16px;
  }

  .pp-content {
    padding: 18px 16px 32px;
  }

  .pp-topbar-links {
    width: 100%;
    order: 3;
  }

  .pp-topbar-spacer {
    display: none;
  }
}
