/* ═══════════════════════════════════════════════════════════════════════════
   CRONY — profile.css   v1.6.0
   Profile screen — identity card, name edit, password change, danger zone.
   All class names reconciled with index.html + profile.js.
   ═══════════════════════════════════════════════════════════════════════════ */

.profile-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: min(100%, 760px);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6) var(--space-12);
}

.profile-avatar-wrap { flex-shrink: 0; }
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--text-main), color-mix(in oklch, var(--accent) 50%, var(--text-main)));
  color: var(--bg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
  box-shadow: var(--shadow-md);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-identity-card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: linear-gradient(180deg, color-mix(in oklch, var(--bg-card) 82%, white), var(--bg-card));
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.profile-identity-info {
  flex: 1;
  min-width: min(260px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.profile-identity-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.profile-identity-email {
  font-size: var(--text-sm);
  color: var(--text-body);
  overflow-wrap: anywhere;
}
.profile-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  width: fit-content;
}
.profile-identity-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.profile-section-card {
  background: color-mix(in oklch, var(--color-surface) 96%, var(--bg-card));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.profile-section-card[data-hidden="true"] { display: none !important; }
.profile-section-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--divider);
}

.profile-form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.profile-form-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-kicker);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-form-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1.5px solid var(--nav-pill-border);
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--bg-cream) 88%, white);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 0 var(--space-3);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.profile-form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}
.profile-form-input::placeholder { color: var(--text-watermark); }
.profile-form-hint {
  font-size: var(--text-xs);
  color: var(--text-kicker);
  line-height: 1.5;
}

.profile-field-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.profile-field-row .profile-form-input {
  flex: 1 1 240px;
  min-width: 0;
}

.profile-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.profile-pw-wrap .profile-form-input { padding-right: 40px; width: 100%; }
.profile-pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-kicker);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.profile-pw-toggle:hover { color: var(--text-main); background: var(--nav-pill-bg); }

.profile-pw-actions,
.profile-actions,
.profile-danger-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.profile-danger-card {
  background: linear-gradient(180deg, rgba(155, 28, 28, 0.03), rgba(155, 28, 28, 0.06));
  border: 1px solid rgba(155, 28, 28, 0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.profile-danger-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-error);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.profile-danger-desc {
  font-size: var(--text-sm);
  color: var(--text-body);
  max-width: 48ch;
}

@media (max-width: 768px) {
  .profile-layout {
    width: 100%;
    padding: var(--space-3) var(--space-3) var(--space-10);
    gap: var(--space-4);
  }
  .profile-identity-card {
    gap: var(--space-4);
    padding: var(--space-4);
    align-items: flex-start;
  }
  .profile-avatar { width: 56px; height: 56px; font-size: 1.2rem; }
  .profile-section-card,
  .profile-danger-card { padding: var(--space-4); }
  .profile-field-row { flex-direction: column; align-items: stretch; }
  .profile-field-row .profile-form-input { width: 100%; flex: 1 1 auto; }
  .profile-pw-actions,
  .profile-actions,
  .profile-danger-actions { flex-direction: column; }
  .profile-pw-actions .btn,
  .profile-actions .btn,
  .profile-danger-actions .btn,
  .profile-identity-actions .btn {
    width: 100%;
  }
  .profile-identity-actions {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .profile-layout { max-width: 100%; }
  .profile-identity-name { font-size: var(--text-md); }
  .profile-identity-email { font-size: 0.84rem; }
  .profile-section-title,
  .profile-danger-title { letter-spacing: 0.05em; }
}
