:root {
  /* Profile card palette from platform.html. */
  --module-primary: #0d6a3b;
  --module-primary-dark: #094824;
  --module-primary-light: #e7f4eb;
  --module-on-light: var(--module-primary);
  --module-primary-border: color-mix(in srgb, var(--module-primary) 30%, #ffffff);
  --module-focus: var(--module-primary);
  --brand-green: var(--module-on-light);
  --brand-green-dark: var(--module-primary-dark);
  --brand-green-soft: var(--module-primary-light);
  --brand-green-border: var(--module-primary-border);

  --cream: #f7f3e8;
  --white: #ffffff;
  --text: #17211d;
  --muted: #66726b;
  --border: #d8ded9;

  --success: #137333;
  --warning: #b76e00;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f7f3e8 0%, var(--module-primary-light) 100%);
}

.site-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 60px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}

.nav-links a.active {
  border-bottom: 2px solid var(--brand-green);
}

.logout-button {
  border: 0;
  background: var(--brand-green);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.logout-button:hover {
  background: var(--brand-green-dark);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.profile-hero {
  background: var(--brand-green);
  color: var(--white);
  border-radius: 32px;
  padding: 42px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--module-primary) 20%, transparent);
}

.profile-hero > .module-hero-copy {
  width: 100%;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--module-primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 900;
}

.profile-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.profile-hero p:not(.eyebrow) {
  max-width: none;
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  line-height: 1.55;
}

.grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.card {
  background: var(--white);
  border: 1px solid var(--brand-green-border);
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 16px 42px color-mix(in srgb, var(--module-primary) 8%, transparent);
}

.card.wide {
  grid-column: 1 / -1;
}

.card h2 {
  margin: 0 0 16px;
  color: var(--brand-green);
}

.content-box {
  color: var(--text);
}

.profile-picture-editor {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 0 22px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.profile-picture-preview {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  overflow: hidden;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--module-primary) 18%, transparent);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
}

.profile-picture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-controls {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.profile-picture-controls > strong {
  color: var(--brand-green);
}

.profile-picture-controls p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.picture-picker {
  max-width: 430px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 9px 14px;
  border: 1px dashed var(--brand-green-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--module-primary-light) 55%, #ffffff);
  color: var(--muted);
  cursor: pointer;
}

.picture-picker:hover,
.picture-picker:focus-within {
  border-color: var(--brand-green);
}

.picture-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.picture-picker span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picture-picker strong {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-green);
  color: var(--white);
  font-size: 12px;
}

.profile-picture-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.picture-message {
  min-height: 18px;
  color: var(--error);
  font-size: 13px;
  font-weight: 700;
}

.info-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .profile-picture-editor {
    align-items: flex-start;
    flex-direction: column;
  }
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row strong {
  color: var(--brand-green);
}

.verification-value {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.verification-value .badge {
  margin-left: 0;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  margin-left: 8px;
}

.badge.success {
  background: #e6f4ea;
  color: var(--success);
}

.badge.warning {
  background: #fff4db;
  color: var(--warning);
}

.badge.error {
  background: #fde8e5;
  color: var(--error);
}

.org-list,
.request-list {
  display: grid;
  gap: 14px;
}

.org-card,
.request-card {
  border: 1px solid var(--border);
  background: #fbfcfa;
  border-radius: 18px;
  padding: 18px;
}

.org-card h3,
.request-card h3 {
  margin: 0 0 8px;
  color: var(--brand-green);
}

.org-meta,
.request-meta {
  color: var(--muted);
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.action-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-button.approve {
  background: var(--success);
  color: white;
}

.action-button.reject {
  background: var(--error);
  color: white;
}

.action-button.secondary {
  background: var(--brand-green);
  color: white;
}

.action-button:hover {
  opacity: 0.9;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.debug-box {
  margin-top: 24px;
  padding: 18px;
  background: #101714;
  color: #eaf0ec;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.hidden {
  display: none;
}

@media (max-width: 800px) {
  .profile-hero,
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card.wide {
    grid-column: auto;
  }

  .info-row {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    height: 48px;
  }
}
.organization-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--brand-green-border);
  border-radius: 28px;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 28px 90px color-mix(in srgb, var(--module-primary-dark) 30%, transparent);
}

.organization-dialog::backdrop {
  background: rgba(8, 32, 20, 0.6);
  backdrop-filter: blur(4px);
}

.organization-dialog-header {
  padding: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.organization-dialog-header h2 {
  margin: 0 0 8px;
  color: var(--brand-green);
  font-size: 30px;
}

.organization-dialog-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-eyebrow {
  margin: 0 0 8px !important;
  color: var(--brand-green) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 900;
}

.dialog-close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close-button:hover {
  background: var(--brand-green);
  color: var(--white);
}

.organization-form {
  padding: 24px 28px 28px;
  display: grid;
  gap: 22px;
}

.organization-choice-card,
.organization-panel {
  border: 1px solid var(--brand-green-border);
  border-radius: 24px;
  background: var(--module-primary-light);
  padding: 22px;
}

.organization-choice-card h3,
.organization-panel h3 {
  margin: 0 0 16px;
  color: var(--brand-green);
}

.organization-option {
  min-height: 64px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.organization-option:has(input:checked) {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px var(--module-focus);
}

.organization-option span {
  display: grid;
  gap: 4px;
}

.organization-option strong {
  color: var(--brand-green);
}

.organization-option small {
  color: var(--muted);
  font-weight: 700;
}

.organization-form label {
  color: var(--brand-green);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  gap: 8px;
}

.organization-form input,
.organization-form select,
.organization-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: 0;
  background: var(--white);
  color: var(--text);
  line-height: 1.5;
}

.organization-form input:focus,
.organization-form select:focus,
.organization-form textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px var(--module-focus);
}

.organization-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.organization-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.text-button:hover {
  color: var(--brand-green);
}

.form-message {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--error);
  background: #fff1f1;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .organization-form-grid {
    grid-template-columns: 1fr;
  }

  .organization-dialog-header,
  .organization-form {
    padding-left: 20px;
    padding-right: 20px;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--module-focus);
  outline-offset: 3px;
}


.account-deletion {
  margin-top: 28px;
  border-color: var(--error);
}

.account-deletion h2,
#deleteAccountDialogTitle {
  color: var(--error);
}

.action-button.danger {
  color: var(--white);
  background: var(--error);
}

.action-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

#deleteAccountExplanation {
  line-height: 1.55;
}
