/**
 * Profile edit modal — Quiet Harbor
 */

html.ct-app #profile_edit_modal .modal-dialog {
  width: min(440px, calc(100vw - 24px));
  margin: 48px auto;
}

html.ct-app #profile_edit_modal .modal-content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--ct-shadow-lg, 0 8px 24px rgba(37, 99, 235, 0.12));
}

html.ct-app #profile_edit_modal .modal-header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  margin: 0 !important;
  padding: 16px 20px !important;
  border: 0 !important;
  background: var(--ct-header) !important;
  background-image: linear-gradient(180deg, #18263a 0%, var(--ct-header) 100%) !important;
}

html.ct-app #profile_edit_modal .modal-title {
  order: 1;
  margin: 0 !important;
  margin-left: auto !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--ct-header-fg) !important;
  line-height: 1.3 !important;
  text-align: right !important;
}

html.ct-app #profile_edit_modal .ct-modal-close {
  order: 2;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ct-header-fg) !important;
  opacity: 1 !important;
  font-size: 18px;
  line-height: 30px;
  text-shadow: none;
  cursor: pointer;
  flex-shrink: 0;
}

html.ct-app #profile_edit_modal .ct-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

html.ct-app #profile_edit_modal .modal-body {
  padding: 20px 20px 8px !important;
  background: #F7FAFC !important;
}

html.ct-app #profile_edit_modal .ct-profile-loading,
html.ct-app #profile_edit_modal .ct-profile-empty {
  margin: 32px 0;
  text-align: center;
  color: var(--ct-muted);
  font-size: 13.5px;
}

html.ct-app #profile_edit_modal .ct-profile-panel {
  background: #FFFFFF;
  border: 1px solid var(--ct-border);
  border-radius: 14px;
  padding: 20px 18px 16px;
  box-shadow: var(--ct-shadow);
}

html.ct-app #profile_edit_modal .ct-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

html.ct-app #profile_edit_modal .ct-profile-avatar-wrap {
  position: relative;
  display: inline-block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(19, 32, 51, 0.12);
  border: 3px solid #FFFFFF;
  background: #EEF2F6;
}

html.ct-app #profile_edit_modal .ct-profile-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

html.ct-app #profile_edit_modal .ct-profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(19, 32, 51, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity var(--ct-ease, 160ms ease);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}

html.ct-app #profile_edit_modal .ct-profile-avatar-wrap:hover .ct-profile-avatar-overlay,
html.ct-app #profile_edit_modal .ct-profile-avatar-wrap:focus-within .ct-profile-avatar-overlay {
  opacity: 1;
}

html.ct-app #profile_edit_modal .ct-profile-avatar-label {
  line-height: 1.2;
}

html.ct-app #profile_edit_modal .ct-profile-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

html.ct-app #profile_edit_modal .ct-profile-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ct-muted);
  text-align: center;
}

html.ct-app #profile_edit_modal .ct-profile-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

html.ct-app #profile_edit_modal .ct-profile-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ct-fg);
}

html.ct-app #profile_edit_modal .ct-profile-input {
  border-radius: 10px !important;
  border: 1px solid var(--ct-border) !important;
  min-height: 42px;
  font-size: 14px !important;
  box-shadow: none !important;
  transition: border-color var(--ct-ease, 160ms ease), box-shadow var(--ct-ease, 160ms ease);
}

html.ct-app #profile_edit_modal .ct-profile-input:focus {
  border-color: var(--ct-accent) !important;
  box-shadow: 0 0 0 3px var(--ct-accent-soft) !important;
}

html.ct-app #profile_edit_modal .ct-profile-field--readonly .ct-profile-input {
  background: #F1F5F9 !important;
  color: var(--ct-muted) !important;
  cursor: not-allowed;
}

html.ct-app #profile_edit_modal .ct-profile-readonly-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ct-faint, #94A3B8);
}

html.ct-app #profile_edit_modal .ct-profile-alert {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}

html.ct-app #profile_edit_modal .ct-profile-alert--error {
  background: var(--ct-danger-soft);
  color: var(--ct-danger);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

html.ct-app #profile_edit_modal .ct-profile-alert--success {
  background: var(--ct-accent-soft);
  color: var(--ct-accent-2);
  border: 1px solid var(--ct-accent-mid);
}

html.ct-app #profile_edit_modal .ct-profile-actions {
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ct-border);
}

html.ct-app #profile_edit_modal .ct-profile-btn {
  flex: 1;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  padding: 10px 16px !important;
  min-height: 42px;
  box-shadow: none !important;
}

html.ct-app #profile_edit_modal .ct-profile-btn--primary {
  background: var(--ct-accent) !important;
  border: 1px solid var(--ct-accent) !important;
  color: #fff !important;
}

html.ct-app #profile_edit_modal .ct-profile-btn--primary:hover:not(:disabled) {
  background: var(--ct-accent-2) !important;
  border-color: var(--ct-accent-2) !important;
}

html.ct-app #profile_edit_modal .ct-profile-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

html.ct-app #profile_edit_modal .ct-profile-btn--ghost {
  background: #F8FAFC !important;
  border: 1px solid var(--ct-border) !important;
  color: var(--ct-fg) !important;
}

html.ct-app #profile_edit_modal .ct-profile-btn--ghost:hover {
  background: #EEF2F6 !important;
}

html.ct-app #profile_edit_modal .ct-profile-form.is-saving .ct-profile-btn-text {
  display: none;
}

html.ct-app #profile_edit_modal .ct-profile-form.is-saving .ct-profile-btn-loading {
  display: inline !important;
}
