.auth-header {
  position: relative;
  inset: auto;
  margin: 18px clamp(16px, 4vw, 58px) 0;
}

.auth-shell {
  min-height: calc(100vh - 112px);
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 58px) 0;
}

.auth-card {
  width: min(100%, 560px);
  padding: clamp(26px, 4vw, 42px);
  background: rgba(28, 21, 16, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card.wide {
  width: 100%;
}

.auth-card.account-card {
  width: 100%;
  justify-self: stretch;
  align-self: start;
  min-height: auto;
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(48px, 7vw, 86px) clamp(34px, 5vw, 58px);
  background: linear-gradient(135deg, rgba(28, 21, 16, 0.86), rgba(18, 14, 11, 0.62));
  border: 1px solid var(--line);
  box-shadow: none;
}

.account-card .tag,
.account-card h1,
.account-card > p,
.account-card .auth-note {
  max-width: 980px;
}

.account-card h1 {
  font-size: clamp(54px, 6.4vw, 104px);
  line-height: 0.92;
}

.account-card > p {
  font-size: 18px;
}

.auth-card h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 6vw, 72px);
  overflow-wrap: anywhere;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--paper);
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(234, 216, 189, 0.22);
  background: rgba(8, 6, 4, 0.62);
  color: var(--text);
  font: inherit;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle.is-active {
  color: var(--orange);
}

.password-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle svg circle {
  fill: currentColor;
  stroke: none;
}

.auth-form input:focus {
  outline: 2px solid rgba(240, 107, 31, 0.42);
  border-color: var(--orange);
}

.auth-form > button,
.auth-link-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: white;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.auth-note {
  margin-top: 18px;
}

.auth-note a {
  color: var(--orange);
  font-weight: 900;
}

.auth-error {
  padding: 14px 16px;
  background: rgba(179, 19, 25, 0.18);
  border: 1px solid rgba(239, 43, 36, 0.4);
  color: #ffd4c8;
}

.auth-success {
  padding: 14px 16px;
  background: rgba(240, 107, 31, 0.14);
  border: 1px solid rgba(240, 107, 31, 0.42);
  color: var(--paper);
}

.admin-card {
  justify-self: stretch;
  align-self: start;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

.admin-tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(8, 6, 4, 0.42);
  border: 1px solid var(--line);
  color: var(--paper);
  font-weight: 900;
}

.admin-tabs a.is-active {
  background: linear-gradient(135deg, var(--orange), var(--red));
  border-color: transparent;
  color: #fff;
}

.admin-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.admin-section[hidden] {
  display: none;
}

.admin-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-section-head h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 64px);
}

.admin-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-field {
  display: grid;
  gap: 8px;
  color: var(--paper);
  font-weight: 800;
}

.admin-field.wide {
  grid-column: 1 / -1;
}

.admin-form-divider {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--paper);
  font-family: Oswald, Inter, Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-field span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid rgba(234, 216, 189, 0.22);
  background: rgba(8, 6, 4, 0.62);
  color: var(--text);
  font: inherit;
}

.admin-field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--paper) 50%),
    linear-gradient(135deg, var(--paper) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 22px,
    calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.admin-field textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-edit-form > button {
  grid-column: 1 / -1;
  min-height: 56px;
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.document-upload-form,
.document-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.document-upload-form {
  padding: clamp(20px, 3vw, 32px);
  background: rgba(8, 6, 4, 0.38);
  border: 1px solid var(--line);
}

.document-upload-form > button,
.document-admin-form > button {
  grid-column: 1 / -1;
  min-height: 54px;
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.admin-file-field {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(234, 216, 189, 0.32);
  background: rgba(240, 107, 31, 0.06);
  cursor: pointer;
}

.admin-file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-file-field span {
  color: var(--muted);
  font-size: 13px;
}

.admin-file-field strong {
  color: var(--paper);
  overflow-wrap: anywhere;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-weight: 800;
}

.admin-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--orange);
}

.document-admin-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.document-admin-item {
  display: grid;
  grid-template-columns: minmax(130px, 0.22fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  background: rgba(8, 6, 4, 0.42);
  border: 1px solid var(--line);
}

.document-admin-preview {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  background: #e8dfd1;
}

.document-admin-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.document-admin-preview span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 8px;
  background: rgba(12, 9, 7, 0.88);
  color: var(--paper);
  font-size: 11px;
  font-weight: 900;
}

.document-delete-form button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(211, 36, 30, 0.5);
  background: transparent;
  color: #ff9b8b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-empty {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.profile-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.account-card .profile-grid {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 34px;
}

.profile-grid article,
.admin-grid article {
  min-width: 0;
  padding: 18px;
  background: rgba(8, 6, 4, 0.42);
  border: 1px solid var(--line);
}

.account-card .profile-grid article {
  min-height: 128px;
  padding: 22px;
  background: rgba(8, 6, 4, 0.5);
}

.profile-grid span,
.admin-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.user-table th {
  color: var(--orange);
  font-size: 12px;
  text-transform: uppercase;
}

.profile-grid strong,
.admin-grid strong,
.user-table td {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .auth-header {
    margin: 18px;
  }

  .auth-shell {
    min-height: calc(100vh - 84px);
    padding: 18px;
  }

  .auth-card {
    width: min(100%, 354px);
    padding: 24px 18px;
  }

  .auth-card.account-card {
    width: 100%;
    min-height: auto;
    padding: 30px 18px;
  }

  .auth-card h1 {
    font-size: clamp(38px, 12vw, 52px);
    line-height: 0.98;
  }

  .profile-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-section-head {
    align-items: start;
    flex-direction: column;
  }

  .admin-edit-form {
    grid-template-columns: 1fr;
  }

  .document-upload-form,
  .document-admin-form {
    grid-template-columns: 1fr;
  }

  .document-admin-item {
    grid-template-columns: 1fr;
  }

  .document-admin-preview {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }

  .document-delete-form button {
    width: 100%;
  }

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

  .auth-form > button,
  .auth-link-button {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }
}
