.auth-container {
  max-width: 960px;
  margin: 3rem auto;
  padding: 0 1.5rem 3.5rem;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.auth-header h1 {
  margin: 0 0 0.6rem;
  font-size: 2rem;
  color: var(--color-ink);
  font-family: var(--font-display);
}

.auth-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
}

.auth-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-group label {
  font-weight: 600;
  color: var(--color-ink);
  font-size: 0.95rem;
}

.checkbox-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  line-height: 1.35;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  accent-color: var(--color-accent-strong);
}

.form-help {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.form-control {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent-strong);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.password-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.password-field .form-control {
  flex: 1;
}

.toggle-password {
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-muted);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-password:hover {
  background: #e7eef5;
}

.password-rules {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.password-rules li {
  list-style: disc;
  transition: color 0.2s ease;
}

.password-rules li.rule-met {
  color: #15803d;
  font-weight: 600;
}

.password-rules li.rule-missed {
  color: #b91c1c;
  font-weight: 600;
}

.form-error {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.form-messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-message {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.form-message.error {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.form-message.info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-strong), #79b8dd);
  color: #fff;
  box-shadow: 0 12px 24px rgba(12, 35, 56, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(12, 35, 56, 0.24);
}

.btn-secondary {
  background: rgba(125, 182, 216, 0.14);
  color: var(--color-ink);
  border: 1px solid rgba(125, 182, 216, 0.35);
}

.auth-footer {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--color-muted);
}

.auth-footer a {
  color: var(--color-accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.auth-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.dev-note {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.15);
  color: #334155;
  font-size: 0.9rem;
}

.dev-note span {
  font-weight: 700;
  letter-spacing: 1px;
}

.profile-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-strong);
  border: 1px solid var(--color-border);
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.profile-avatar {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
}

.profile-avatar-button:focus-visible {
  outline: 3px solid var(--color-accent-soft);
  outline-offset: 6px;
  border-radius: 32px;
}

.profile-avatar img,
.profile-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: rgba(125, 182, 216, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #2c4a5e;
  font-weight: 700;
  border: 2px solid rgba(125, 182, 216, 0.4);
  object-fit: cover;
}

.profile-avatar [hidden] {
  display: none !important;
}

.profile-avatar-edit {
  position: absolute;
  bottom: -0.35rem;
  right: -0.35rem;
  background: #fff;
  border: 1px solid rgba(125, 182, 216, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-muted);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.profile-avatar-button:hover .profile-avatar-edit,
.profile-avatar-button:focus-visible .profile-avatar-edit {
  opacity: 1;
  transform: translateY(0);
}

.profile-meta h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.profile-subtext {
  margin: 0;
  color: var(--color-muted);
}

.profile-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.inline-form,
.nav-inline-form {
  margin: 0;
}

.inline-form button,
.nav-inline-form button {
  border: none;
  background: none;
  cursor: pointer;
}

.profile-stats {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(125, 182, 216, 0.14);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(125, 182, 216, 0.2);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-ink);
}

.stat-label {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.profile-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1.5rem;
}

.profile-panel {
  background: var(--color-surface-alt);
  padding: 1.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.profile-panel.highlight {
  background: linear-gradient(135deg, rgba(125, 182, 216, 0.2), rgba(255, 255, 255, 0.9));
}

.profile-panel h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.profile-panel.admin-panel {
  grid-column: 1 / -1;
  background: linear-gradient(120deg, rgba(125, 182, 216, 0.18), rgba(255, 255, 255, 0.95));
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.badge.admin-role {
  background: rgba(63, 132, 184, 0.16);
  color: #1d4ed8;
}

.admin-status {
  margin: 0.75rem 0 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-status-text {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.badge.status-pending {
  background: rgba(234, 179, 8, 0.18);
  color: #92400e;
}

.badge.status-approved {
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
}

.badge.status-rejected {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.admin-feedback {
  background: rgba(248, 113, 113, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.admin-feedback p {
  margin: 0.4rem 0 0;
}

.admin-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-apply-card {
  border: 1px solid rgba(125, 182, 216, 0.24);
}

.admin-apply-note {
  margin: 1.5rem 0;
  padding: 1.25rem 1.4rem;
  border-radius: 16px;
  background: rgba(125, 182, 216, 0.12);
  border: 1px solid rgba(125, 182, 216, 0.2);
}

.admin-apply-note h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.admin-apply-note ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-muted);
  display: grid;
  gap: 0.4rem;
}

.verification-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.verification-row a {
  color: var(--color-accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.verified {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.badge.pending {
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.impact-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.avatar-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1200;
}

.avatar-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.avatar-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.avatar-modal__dialog {
  position: relative;
  background: var(--color-surface);
  border-radius: 24px;
  width: min(760px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-strong);
  display: grid;
  gap: 1.5rem;
}

.avatar-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.avatar-modal__header h2 {
  margin: 0 0 0.3rem;
  font-size: 1.6rem;
}

.avatar-modal__close {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.avatar-modal__body {
  display: grid;
  gap: 1.5rem;
}

.avatar-preview-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 1.4rem;
  border-radius: 20px;
  background: rgba(125, 182, 216, 0.14);
  border: 1px solid rgba(125, 182, 216, 0.24);
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  background: #fff;
  border: 1px dashed rgba(125, 182, 216, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-preview img,
.avatar-preview__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.avatar-preview [hidden] {
  display: none !important;
}

.avatar-preview__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #2c4a5e;
}

.avatar-section {
  background: var(--color-surface-alt);
  border-radius: 20px;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  display: grid;
  gap: 0.75rem;
}

.avatar-section h3 {
  margin: 0;
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.avatar-file-name {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.avatar-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.avatar-style {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 18px;
  padding: 0.85rem 0.75rem;
  display: grid;
  gap: 0.4rem;
  align-items: center;
  justify-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-ink);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.avatar-style img {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(125, 182, 216, 0.2);
}

.avatar-style.is-active {
  border-color: var(--color-accent-strong);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
  transform: translateY(-2px);
}

.avatar-controls label {
  font-weight: 600;
}

.avatar-control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.avatar-control-row input[type='color'] {
  width: 44px;
  height: 44px;
  border: none;
  padding: 0;
  background: transparent;
}

.avatar-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }

  .auth-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .profile-card {
    padding: 2rem 1.5rem;
  }

  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .profile-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .profile-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

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

  .avatar-preview-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar-modal__dialog {
    padding: 1.5rem;
  }
}
