.customer-profile {
  width: 100%;
  max-width: 1200px;
}

.customer-profile__section {
  margin-bottom: 3rem;
}

.customer-profile__section h1 {
  margin: 0 0 2rem;
}

.customer-profile .save-button:disabled,
.customer-profile .reset-button:disabled{
  background: #aeb4bf;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.65;
}

.customer-profile .save-button:disabled:hover,
.customer-profile .reset-button:disabled:hover {
  background: #aeb4bf;
  transform: none;
}

.profile-form {
  width: 100%;
}

.profile-form[data-submitting="true"] {
  cursor: wait;
}

.profile-form[data-submitting="true"] input,
.profile-form[data-submitting="true"] select,
.profile-form[data-submitting="true"] textarea {
  cursor: wait;
}
/* ========================================
   Hauptgrid
======================================== */

.profile-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.profile-account-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 1.5rem;

  margin-bottom: 2rem;
  padding: 1rem 1.25rem;

  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

#profile-customer-number-group {
  justify-self: end;
  text-align: right;
}

.profile-account-info__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-account-info__item span {
  color: #6b7280;
  font-size: 0.875rem;
}

.profile-account-info__item[hidden] {
  display: none;
}

/* ========================================
   Formularfelder
======================================== */

.customer-profile .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  min-width: 0;
}

.customer-profile .form-group input[readonly] {
  color: #6b7280;
  background: #f3f4f6;
  cursor: default;
}

.customer-profile .form-group input[readonly]:focus {
  border-color: var(--border);
  background: #f3f4f6;
  box-shadow: none;
}

.customer-profile .form-group.full-width {
  grid-column: 1 / -1;
}

.customer-profile .form-group label {
  font-weight: 400;
}

.customer-profile .form-group input,
.customer-profile .form-group select,
.customer-profile .form-group textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  box-sizing: border-box;
  background: #ffffff;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.customer-profile .form-group input:focus,
.customer-profile .form-group select:focus,
.customer-profile .form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(255, 0, 152, 0.12);
}

/* ========================================
   Select
======================================== */

.customer-profile .select-wrapper {
  position: relative;

  display: block;
  width: 100%;
  margin: 0;
}

.customer-profile .select-wrapper select {
  padding-right: 2.5rem;
}

.customer-profile .select-arrow {
  position: absolute;
  top: 50%;
  right: 0.85rem;

  width: 9px;
  height: 9px;

  color: var(--color-text);
  pointer-events: none;

  transform: translateY(-50%);
}

/* ========================================
   Validierung
======================================== */

.field-error {
  margin-top: 0.35rem;

  color: #ec0909;
  font-size: 0.875rem;
  line-height: 1.4;
}

.field-error[hidden] {
  display: none;
}

.customer-profile .field-error__item + .field-error__item {
  margin-top: 0.2rem;
}

.customer-profile .form-group input.is-invalid,
.customer-profile .form-group select.is-invalid,
.customer-profile .form-group textarea.is-invalid {
  border-color: #ec0909;
  background: #fff7f7;
}

.customer-profile .form-group input.is-invalid:focus,
.customer-profile .form-group select.is-invalid:focus,
.customer-profile .form-group textarea.is-invalid:focus {
  border-color: #ec0909;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.customer-profile .form-group input.is-valid,
.customer-profile .form-group select.is-valid,
.customer-profile .form-group textarea.is-valid {
  border-color: var(--border);
}

/* ========================================
   Geschäftskundenfelder
======================================== */

.customer-profile .business-fields {
  grid-column: 1 / -1;

  margin-top: 0.5rem;
  padding-top: 1.75rem;

  border-top: 1px solid var(--border);
}

.customer-profile .business-fields[hidden] {
  display: none;
}

.customer-profile .business-fields__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.customer-profile .button-row {
  width: calc(50% - 0.75rem);
  min-width: 0;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;

  margin-top: 2rem;
}

.customer-type-badge {
  color: var(--color-text);
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 768px) {
  .profile-form__grid,
  .customer-profile .business-fields__grid {
    grid-template-columns: 1fr;
  }

  .customer-profile .form-group.full-width,
  .customer-profile .business-fields {
    grid-column: 1;
  }

  .customer-profile .button-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

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

  #profile-customer-number-group {
    justify-self: start;
    text-align: left;
  }
}
