:root {
  --color-page: #ffffff;
  --color-text: #314040;
  --color-muted: #5f6b6d;
  --color-border: #dce8ef;
  --color-field: #f8fafc;
  --color-teal: #00a29d;
  --color-teal-dark: #008c88;
  --color-teal-deep: #006f6c;
  --color-orange: #ee9304;
  --font-body: "Manrope", sans-serif;
  --font-heading: "Plus Jakarta Sans", sans-serif;
  --font-be-vietnam-pro: "Be Vietnam Pro", sans-serif;
  --font-exo: "Exo", sans-serif;
  --font-accent: "Exo 2", sans-serif;
  --font-material-symbols-outlined: "Material Symbols Outlined", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: #e5f6f3;
  color: var(--color-text);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.account-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background-color: #ffffff;
  background-image: url("./paw-pattern-background.svg");
  background-position: center top;
  background-repeat: repeat;
  background-size: 760px auto;
}

.account-dialog {
  width: min(100%, 440px);
  border: 1px solid rgba(220, 232, 239, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(49, 64, 64, 0.14);
  overflow: hidden;
}

.account-dialog:has(#login-view.active) {
  width: min(100%, 472px);
  border-radius: 28px;
  border-color: rgba(223, 232, 237, 0.85);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 54px rgba(30, 72, 72, 0.22);
}

.account-dialog:has(#register-view.active) {
  width: min(100%, 502px);
  border-radius: 28px;
  border-color: rgba(223, 232, 237, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 48px rgba(49, 64, 64, 0.16);
}

.account-dialog:has(#reset-view.active) {
  width: min(100%, 402px);
  border-radius: 28px;
  border-color: rgba(223, 232, 237, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 52px rgba(49, 64, 64, 0.18);
}

.account-dialog:has(#verify-view.active) {
  width: min(100%, 380px);
  border-radius: 28px;
  border-color: rgba(223, 232, 237, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 52px rgba(49, 64, 64, 0.18);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 18px;
}

.dialog-header > div {
  width: 100%;
}

.account-logo {
  display: block;
  width: auto;
  height: 80px;
  margin: 0 auto 10px;
}

.account-dialog:has(#login-view.active) .dialog-header {
  justify-content: center;
  padding: 42px 42px 22px;
  text-align: center;
}

.account-dialog:has(#register-view.active) .dialog-header {
  padding: 30px 30px 0;
}

.account-dialog:has(#reset-view.active) .dialog-header {
  padding: 28px 30px 0;
}

.account-dialog:has(#verify-view.active) .dialog-header {
  justify-content: center;
  padding: 38px 28px 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-accent);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow-peta {
  color: var(--color-orange);
}

.eyebrow-friend {
  color: var(--color-teal);
}

.eyebrow-account {
  color: var(--color-orange);
}

h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.account-dialog:has(#login-view.active) h1 {
  color: #13243f;
  font-size: 36px;
  line-height: 1.05;
}

.account-dialog:has(#register-view.active) h1 {
  color: #13243f;
  font-size: 34px;
  line-height: 1.08;
}

.account-dialog:has(#reset-view.active) h1 {
  color: #202a3b;
  font-size: 32px;
  line-height: 1.08;
}

.account-dialog:has(#verify-view.active) h1 {
  color: #13243f;
  font-size: 34px;
  line-height: 1.08;
}

.dialog-body {
  padding: 0 28px 28px;
}

.account-dialog:has(#login-view.active) .dialog-body {
  padding: 0 40px 40px;
}

.account-dialog:has(#register-view.active) .dialog-body {
  padding: 0 30px 28px;
}

.account-dialog:has(#reset-view.active) .dialog-body {
  padding: 0 30px 30px;
}

.account-dialog:has(#verify-view.active) .dialog-body {
  padding: 0 28px 32px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

#login-view .provider-grid {
  gap: 18px;
  margin: 8px 0 24px;
}

.provider-button,
.ghost-button,
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  color: #354140;
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.provider-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: var(--color-teal);
  color: var(--color-teal-dark);
  background: #f3f9fb;
  transform: translateY(-1px);
}

.form-stack {
  display: grid;
  gap: 14px;
}

#login-view .form-stack {
  gap: 18px;
}

#register-view .form-stack {
  gap: 14px;
}

#reset-view .form-stack {
  gap: 18px;
}

#verify-view .form-stack {
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
}

#login-view .login-field {
  gap: 9px;
  color: #273445;
  font-size: 16px;
  font-weight: 800;
}

.input-shell {
  position: relative;
  display: block;
}

.input-shell input {
  padding-left: 50px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 1;
  width: 22px;
  height: 22px;
  color: #9aa3aa;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

#register-view .back-button {
  margin: 6px 0 24px;
  color: var(--color-teal-dark);
  font-size: 16px;
  font-weight: 800;
}

#reset-view .back-button {
  position: relative;
  margin: 14px 0 30px 18px;
  color: var(--color-teal-dark);
  font-size: 16px;
  font-weight: 800;
}

#reset-view .back-button::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

#verify-view .back-button {
  margin: 14px 0 24px 0;
  color: var(--color-teal-dark);
  font-size: 15px;
  font-weight: 800;
}

#register-view .register-field {
  gap: 8px;
  color: #273445;
  font-size: 16px;
  font-weight: 800;
}

.register-input-shell {
  position: relative;
  display: block;
}

.register-input-shell input {
  padding-left: 50px;
}

.register-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 1;
  width: 22px;
  height: 22px;
  color: var(--color-teal-dark);
  pointer-events: none;
  transform: translateY(-50%);
}

.register-input-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7dde2;
  border-radius: 8px;
  background: var(--color-field);
  color: var(--color-text);
  outline: none;
  padding: 12px 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

#login-view input {
  min-height: 52px;
  border-radius: 12px;
  border-color: #d6dce1;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(28, 48, 60, 0.04);
  color: #273445;
  font-size: 16px;
  font-weight: 700;
}

#register-view input {
  min-height: 48px;
  border-radius: 8px;
  border-color: #d2dce1;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(28, 48, 60, 0.04);
  color: #273445;
  font-size: 16px;
  font-weight: 700;
}

#reset-view label {
  gap: 8px;
  color: #424a55;
  font-size: 16px;
  font-weight: 500;
}

#reset-view input {
  min-height: 40px;
  border-radius: 6px;
  border-color: #cfd8df;
  background: #ffffff;
  color: #273445;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(28, 48, 60, 0.04);
}

#verify-view label {
  gap: 9px;
  color: #273445;
  font-size: 15px;
  font-weight: 800;
}

#verify-view .verification-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

#verify-view .verification-grid input {
  min-height: 44px;
  border-radius: 8px;
  border-color: #c8d5e3;
  background: #eaf1fb;
  color: #273445;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(28, 48, 60, 0.06);
}

#verify-view .verification-grid input:focus {
  border-color: #3d91c8;
  background: #f8fbff;
  box-shadow: 0 0 0 2px rgba(61, 145, 200, 0.18);
}

input:focus {
  border-color: var(--color-teal-dark);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(55, 170, 165, 0.14);
}

.primary-button {
  position: relative;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--color-teal);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(42, 156, 152, 0.2);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

#login-view .primary-button {
  min-height: 56px;
  border-radius: 999px;
  background: var(--color-teal);
  font-size: 16px;
  box-shadow: 0 12px 20px rgba(42, 156, 152, 0.28);
}

#register-view .primary-button {
  min-height: 48px;
  margin-top: 4px;
  border-radius: 8px;
  background: var(--color-teal);
  font-size: 16px;
  box-shadow: 0 10px 18px rgba(42, 156, 152, 0.24);
}

.register-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 4px;
}

.register-provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  gap: 10px;
  border: 1px solid #dde3e7;
  border-radius: 999px;
  background: #ffffff;
  color: #172033;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(29, 50, 58, 0.06);
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.register-provider-button:hover {
  border-color: var(--color-teal);
  color: var(--color-teal-dark);
  background: #f3f9fb;
  transform: translateY(-1px);
}

.register-provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.register-provider-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.register-provider-icon-apple {
  color: #000000;
}

.register-provider-icon-google {
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

#reset-view .primary-button {
  min-height: 46px;
  margin-top: 4px;
  border-radius: 7px;
  background: var(--color-teal);
  font-size: 16px;
  box-shadow: 0 10px 18px rgba(42, 156, 152, 0.22);
}

#verify-view .primary-button {
  min-height: 60px;
  border-radius: 7px;
  background: var(--color-teal);
  font-size: 16px;
  box-shadow: 0 10px 18px rgba(42, 156, 152, 0.22);
}

#verify-view .status-message {
  display: block;
  margin: 16px auto 0;
  padding: 0;
  max-width: 310px;
  background: transparent;
  color: #202a3b;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

#verify-view .status-message:empty {
  display: block;
}

#verify-view .status-message:empty::before {
  content: "A verification email has been sent to your inbox. Please enter the six-digit code to verify your account. It may take a few minutes.";
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(42, 156, 152, 0.24);
}

.ghost-button {
  width: auto;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--color-teal-dark);
  padding: 0;
  text-align: left;
  transform: none;
}

.back-to-login {
  width: auto;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--color-teal-dark);
  padding: 0;
  margin-top: 14px;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  transform: none;
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.back-to-login:hover {
  background: transparent;
  text-decoration: underline;
  transform: none;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--color-teal-dark);
  padding: 0;
  margin: 0 0 18px 0;
  text-align: left;
  transform: none;
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.back-button:hover {
  background: transparent;
  text-decoration: underline;
  transform: none;
}

.ghost-button:hover {
  background: transparent;
  text-decoration: underline;
  transform: none;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 6px;
  margin: 0 40px 0 24px;
  color: var(--color-muted);
  font-size: 14px;
}

#login-view .row-actions {
  margin: 0;
  padding: 0;
  font-size: 16px;
}

#login-view .ghost-button {
  color: var(--color-teal-dark);
  font-size: 16px;
  font-weight: 800;
}

#login-view .provider-button {
  min-height: 56px;
  gap: 11px;
  border-radius: 999px;
  border-color: #dde3e7;
  color: #172033;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(29, 50, 58, 0.06);
}

.provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
}

.provider-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.provider-icon-apple {
  color: #000000;
}

.provider-icon-google {
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.status-message {
  display: none;
  border-radius: 8px;
  margin: 14px 0 0;
  padding: 12px 14px;
  background: transparent;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.status-message.error {
  background: #fff2ea;
  color: #b45309;
}

.status-message.visible {
  display: block;
}

.verification-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.verification-grid input {
  min-height: 48px;
  padding: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin: 0 auto;
}

.is-loading .button-label {
  display: none;
}

.is-loading .spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 520px) {
  .account-page {
    align-items: stretch;
    padding: 14px;
  }

  .account-dialog {
    width: 100%;
  }

  .dialog-header,
  .dialog-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-actions {
    flex-direction: row;
  }
}
/* =====================================================
   AUTHENTICATION LOADING OVERLAY
   ===================================================== */

body.auth-loading {
  overflow: hidden;
}

.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(245, 252, 251, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.auth-loading-overlay.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.auth-loading-card {
  width: min(100%, 390px);
  padding: 36px 30px 32px;
  border: 1px solid rgba(211, 229, 232, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 65px rgba(30, 72, 72, 0.2);
  text-align: center;
}

.auth-loading-spinner {
  width: 62px;
  height: 62px;
  margin: 0 auto 24px;
  border: 6px solid rgba(0, 162, 157, 0.18);
  border-top-color: var(--color-teal);
  border-right-color: var(--color-orange);
  border-radius: 50%;
  animation: auth-loading-spin 900ms linear infinite;
}

.auth-loading-title {
  margin: 0 0 12px;
  color: #13243f;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.auth-loading-text {
  min-height: 48px;
  margin: 0;
  color: #405052;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.auth-loading-text.changing {
  opacity: 0;
  transform: translateY(4px);
}

.auth-loading-note {
  margin: 18px 0 0;
  color: #778386;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

@keyframes auth-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 520px) {
  .auth-loading-overlay {
    padding: 18px;
  }

  .auth-loading-card {
    padding: 32px 22px 28px;
    border-radius: 20px;
  }

  .auth-loading-spinner {
    width: 56px;
    height: 56px;
  }

  .auth-loading-title {
    font-size: 22px;
  }

  .auth-loading-text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-loading-overlay,
  .auth-loading-text {
    transition: none;
  }

  .auth-loading-spinner {
    animation-duration: 1400ms;
  }
}