/* Agent / Admin / Register — Edit Profile */

.agent-edit-profile {
  --aep-accent: var(--accent, #0a5c54);
  --aep-accent-hover: var(--accent-hover, #084841);
  --aep-line: var(--line, #e2e8f0);
  --aep-text: var(--text-primary, #0f172a);
  --aep-muted: var(--text-secondary, #64748b);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 !important;
  background: #fff;
  border: 1px solid var(--aep-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.agent-edit-profile.panel {
  padding: 0 !important;
}

.agent-edit-profile__head {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--aep-line);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.agent-edit-profile__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aep-text);
  letter-spacing: 0.01em;
}

.agent-edit-profile__head .muted {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
}

.agent-edit-profile__form {
  padding: 1.35rem 1.35rem 1.6rem;
  display: block;
}

.agent-edit-profile__section-title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aep-accent);
}

.agent-edit-profile__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.15rem;
}

.agent-edit-profile__field--full {
  grid-column: 1 / -1;
}

.agent-edit-profile__field {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.4rem !important;
  margin: 0 !important;
}

.agent-edit-profile__label {
  display: block;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  line-height: 1.3;
}

.agent-edit-profile__label .req {
  color: #dc2626;
  margin-left: 0.15rem;
}

.agent-edit-profile__input {
  box-sizing: border-box;
  width: 100% !important;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.875rem !important;
  line-height: 1.35 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--aep-text) !important;
  box-shadow: none !important;
}

.agent-edit-profile__input:focus {
  outline: none !important;
  border-color: var(--aep-accent) !important;
  box-shadow: 0 0 0 3px rgba(10, 92, 84, 0.15) !important;
}

.agent-edit-profile__input.is-readonly {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
  cursor: default;
}

.agent-edit-profile__readonly {
  margin-bottom: 1.5rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--aep-line);
}

.agent-edit-profile__kyc {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.agent-edit-profile__doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.85rem 1.15rem;
  align-items: end;
  padding: 0.85rem 0.95rem;
  background: #f8fafc;
  border: 1px solid var(--aep-line);
  border-radius: 10px;
}

.agent-edit-profile__field--doc {
  min-width: 0;
}

.agent-edit-profile__upload-col {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}

.agent-edit-profile__upload-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 12rem;
  min-height: 2.5rem;
  max-width: 100%;
  padding: 0.55rem 0.9rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff !important;
  background: var(--aep-accent) !important;
  border-radius: 8px;
  cursor: pointer;
  border: 0;
  overflow: hidden;
  margin: 0;
}

.agent-edit-profile__upload-btn:hover {
  background: var(--aep-accent-hover) !important;
}

.agent-edit-profile__upload-btn.is-uploaded {
  background: var(--aep-accent-hover) !important;
}

.agent-edit-profile__file,
.agent-edit-profile__upload-btn input[type="file"],
.agent-edit-profile .sr-only {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  cursor: pointer !important;
  font-size: 0 !important;
  border: 0 !important;
  clip: auto !important;
  overflow: hidden !important;
  white-space: nowrap;
  z-index: 2;
}

.agent-edit-profile__upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.7rem;
  flex: 0 0 auto;
}

.agent-edit-profile__view-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  min-width: 4.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff !important;
  background: #0f766e !important;
  border-radius: 8px;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.agent-edit-profile__view-btn:hover:not(.is-disabled) {
  background: #0d9488 !important;
  color: #fff !important;
}

.agent-edit-profile__view-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  background: #94a3b8 !important;
}

.agent-edit-profile__upload-hint {
  flex: 1 0 100%;
  margin: 0;
  font-size: 0.7rem;
  color: var(--aep-muted);
}

.agent-edit-profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--aep-line);
}

.agent-edit-profile__submit {
  min-width: 11rem;
  min-height: 2.65rem;
  padding: 0.65rem 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 8px !important;
}

.agent-edit-profile .field-error {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
}

.agent-edit-profile--register {
  max-width: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.agent-edit-profile--register .agent-edit-profile__head {
  background: transparent;
  border-bottom: 0;
  padding: 0 0 0.75rem;
}

.agent-edit-profile--register .agent-edit-profile__form {
  padding: 0;
}

.agent-edit-profile--register .agent-edit-profile__actions {
  justify-content: stretch;
}

.agent-edit-profile--register .agent-edit-profile__submit {
  width: 100%;
}

.agent-doc-modal__card {
  width: min(96vw, 900px);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--aep-line);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.agent-doc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--aep-line);
  background: #f8fafc;
}

.agent-doc-modal__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
}

.agent-doc-modal__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0.15rem 0.35rem;
}

.agent-doc-modal__close:hover {
  color: #0f172a;
}

.agent-doc-modal__body {
  flex: 1;
  min-height: 0;
  background: #e2e8f0;
}

.agent-doc-modal__frame {
  display: block;
  width: 100%;
  height: min(75vh, 680px);
  border: 0;
  background: #fff;
}

@media (max-width: 820px) {
  .agent-edit-profile__grid,
  .agent-edit-profile__doc-row {
    grid-template-columns: 1fr;
  }

  .agent-edit-profile__doc-row {
    align-items: stretch;
  }

  .agent-edit-profile__upload-btn {
    flex-basis: 100%;
  }
}