.auth-page {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 48px;
  gap: 24px;
}

/* ── Top section ── */

.auth-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-badr-wrap {
  margin-bottom: 4px;
}

.auth-greeting {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.auth-sub {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* ── Profile tiles ── */

.auth-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
  max-width: 480px;
}

.auth-profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 20px;
  border: none;
  background: #f0ece4;
  cursor: pointer;
  box-shadow: 0 4px 0 #ddd9d0;
  transition: transform 0.1s, box-shadow 0.1s;
  min-width: 100px;
}
.auth-profile-tile:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #ddd9d0;
}

.auth-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.auth-profile-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: none;
}

.auth-avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.auth-avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid transparent;
  outline: 3px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, outline-color 0.15s;
  object-fit: cover;
  box-sizing: border-box;
}
.auth-avatar-option:hover { border-color: var(--green); outline-color: var(--green); }
.auth-avatar-selected { border-color: var(--green); outline-color: var(--green); outline-offset: 2px; }
.auth-avatar-none {
  background: #e8e4dc;
  color: #aaa;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-profile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* ── Add profile button ── */

.auth-add-wrap {
  width: 100%;
  max-width: 480px;
}

.auth-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.auth-add-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(29, 158, 117, 0.04);
}

.auth-add-icon {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

/* ── Add profile form ── */

.auth-form-wrap {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 8, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  z-index: 20;
  animation: authOverlayIn 0.2s ease;
}

@keyframes authOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-form-card {
  background: var(--bg);
  border-radius: 28px;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 6px 0 #e0d8cc;
  animation: authCardIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-form-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-label-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
}

.auth-input {
  width: 100%;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  border: 2px solid #e0d8cc;
  border-radius: 14px;
  padding: 12px 16px;
  background: transparent;
  outline: none;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--green); }
.auth-input.shake {
  border-color: #e05050;
  animation: input-shake 0.4s ease;
}

@keyframes input-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}

/* ── Social login ── */

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 2px solid #e0d8cc;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.auth-social-btn:hover { background: #f8f6f2; border-color: #c8c0b4; }
.auth-social-btn:active { background: #f0ece4; }

.auth-apple-btn { color: #1a1a18; }

.auth-google-btn { color: #444; }

/* ── Divider ── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Inline error ── */

.auth-error {
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
  background: #fdf0ee;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
}

/* ── OTP ── */

.auth-otp-msg {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.auth-otp-input {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
}

.auth-resend-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  text-align: center;
  padding: 0;
}
.auth-resend-btn:not(:disabled) { color: var(--green); }

/* ── Form actions ── */

.auth-form-actions {
  display: flex;
  gap: 10px;
}

.auth-cancel-btn {
  flex: 1;
  padding: 14px;
  border-radius: 16px;
  border: none;
  background: #f0ece4;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #ddd9d0;
  transition: transform 0.1s, box-shadow 0.1s;
}
.auth-cancel-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #ddd9d0; }

.auth-submit-btn {
  flex: 2;
  padding: 14px;
  border-radius: 16px;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--green-dark);
  transition: transform 0.1s, box-shadow 0.1s;
}
.auth-submit-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-dark); }
