* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: .9rem;
}

.modals {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  color: var(--color-bg);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 15px;
}

.loadingContainer {
  color: var(--color-gold-500);
  font-weight: 600;
  font-size: 1.1rem;
}

/* From Uiverse.io by aryamitra06 */
.loader {
  display: flex;
  align-items: center;
}

.bar {
  display: inline-block;
  width: 6px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  animation: scale-up4 1s linear infinite;
}

.bar:nth-child(2) {
  height: 35px;
  margin: 0 5px;
  animation-delay: 0.25s;
}

.bar:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes scale-up4 {
  20% {
    background-color: #ffff;
    transform: scaleY(1.5);
  }

  40% {
    transform: scaleY(1);
  }
}

button {
  font-family: inherit;
}

.errorModalCont{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  margin-top: 1rem;
  /* height: 100dvh; */
  background: transparent;
  z-index: 999;
  color: var(--color-bg);
  display: none;
  justify-content: center;
  align-items: center;
  /* flex-direction: column; */
  gap: 15px;
  pointer-events: none;
}

.errorCont{
  background: var(--error-color);
  border-radius: 10px;
  padding: 10px 15px;
  color: var(--color-bg);
  display: flex;
  align-items: center;
  gap: 5px;
  /* justify-content: center; */
  /* flex-direction: column; */
  max-width: 85%;
}

.errorCont p{
  width: max-content;
}

.errorCont .cancelBtnCont{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}

.errorCont .cancelBtnCont button{
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  pointer-events: auto;
}

.errorCont .cancelBtnCont button:hover{
  transform: scale(1.1);
}

.errorCont p{
  font-size: .8rem;
}

/* ----- page shell ----- */
.authShell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background:
    radial-gradient(
      circle at 14% 8%,
      rgba(10, 68, 56, 0.05) 0%,
      transparent 45%
    ),
    var(--color-bg);
}

/* ----- card: white form (60) + deep green brand panel (30) ----- */
.authCard {
  display: flex;
  width: 100%;
  max-width: 66rem;
  min-height: 38rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ================= form panel ================= */
.formPanel {
  flex: 1 1 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 3rem;
}

.formPanel-inner {
  width: 100%;
  max-width: 23rem;
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-600);
  margin-bottom: 1.25rem;
}

/* ----- tab switcher ----- */
.tabSwitcher {
  display: inline-flex;
  gap: 0.2rem;
  background: var(--color-surface-muted);
  border-radius: var(--radius-full);
  padding: 0.28rem;
  margin-bottom: 2.25rem;
}

.tabButton {
  border: none;
  background: transparent;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  letter-spacing: -0.1px;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.tabButton.active {
  background: var(--color-surface);
  color: var(--color-green-900);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.tabButton:hover:not(.active) {
  color: var(--color-text);
}

.tabButton:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ----- forms wrapper: shows one screen at a time ----- */
.formsWrapper {
  position: relative;
}

.signInScreen,
.signUpScreen {
  display: flex;
  flex-direction: column;
  gap: 1.9rem;
}

.signUpScreen {
  display: none;
}

.signUpScreen.visible {
  display: flex;
}

.signInScreen.hidden {
  display: none;
}

/* ----- typography ----- */
.screenTypeHeading {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--color-text);
  line-height: 1.15;
}

.briefDescription {
  font-size: 0.94rem;
  color: var(--color-text-secondary);
  margin-top: 0.45rem;
}

/* ----- fields ----- */
.loginForm,
.signUpForm {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-top: 0.4rem;
}

.emailContainer,
.passwordContainer,
.nameContainer {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
}

.passwordInputWrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: var(--color-surface-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--color-text);
  outline: none;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

input::placeholder {
  color: var(--color-text-muted);
}

input:focus {
  background-color: var(--color-surface);
  box-shadow: var(--shadow-focus);
}

.passwordInputWrapper input {
  padding-right: 3rem;
}

.passwordVisibility {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.passwordVisibility:hover {
  color: var(--color-green-900);
  background: var(--color-green-100);
}

.passwordVisibility:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ----- name row (first / last, signup) ----- */
.nameRow {
  display: flex;
  gap: 0.9rem;
}

.nameRow .nameContainer {
  flex: 1;
}

/* ----- primary action ----- */
.primaryButton {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-gold-500);
  color: var(--color-text-on-gold);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.1s ease;
}

.primaryButton:hover {
  background: var(--color-gold-600);
  box-shadow: var(--shadow-button);
}

.primaryButton:active {
  transform: scale(0.98);
}

.primaryButton:focus-visible {
  outline: none;
  box-shadow: var(--shadow-button), var(--shadow-focus);
}

.subtle-footer {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ================= brand panel (deep green, 30 + gold, 10) ================= */
.brandPanel {
  position: relative;
  flex: 1 1 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: linear-gradient(
    165deg,
    var(--color-green-800) 0%,
    var(--color-green-900) 100%
  );
  overflow: hidden;
}

.brandPanel-weave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.07;
}

.brandPanel-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.crest {
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.18));
}

.crest-wordmark {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-on-green);
}

.crest-divider {
  width: 2.5rem;
  height: 1px;
  background: var(--color-gold-500);
  opacity: 0.6;
  margin: 0.3rem 0 0.5rem;
}

.crest-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-on-green);
  opacity: 0.75;
  line-height: 1.6;
}

.crest-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-gold-500);
  margin-top: 0.6rem;
}



/* ----- accessibility: respect reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ----- responsive ----- */
@media (max-width: 780px) {
  .authCard {
    flex-direction: column-reverse;
    max-width: 28rem;
    min-height: auto;
  }

  .brandPanel {
    padding: 2.25rem 2rem;
  }

  .brandPanel-content {
    gap: 0.4rem;
  }

  .crest svg {
    width: 56px;
    height: 56px;
  }

  .crest-wordmark {
    font-size: 1.7rem;
  }

  .crest-subtitle {
    font-size: 0.7rem;
  }

  .formPanel {
    padding: 2.75rem 2rem 3rem;
  }
}

@media (max-width: 420px) {
  .authShell {
    padding: 1.5rem 1rem;
  }

  .screenTypeHeading {
    font-size: 1.7rem;
  }

  .nameRow {
    flex-direction: column;
    gap: 1.35rem;
  }

  .formPanel {
    padding: 2.25rem 1.5rem 2.5rem;
  }
}

::-webkit-scrollbar{
  background: var(--color-bg);
}

::-webkit-scrollbar-button{
background: var(--color-gold-500);
}

::-webkit-scrollbar-thumb{
  background: var(--color-green-900);
}

.userCategoryContainer{
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.userCategoryContainer select{
  width: 100%;
  height: 2.65rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  border: 1px solid var(--color-text-muted);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.72rem;
  outline: none;
  cursor: pointer;
  /* appearance: none */
  background: var(--color-bg);
  border: none;
}