@font-face {
  font-family: "Inter";
  src: url("../../../public/assets/fonts/inter/InterVariable.woff2")
    format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* ========================================
   GOGYMIO — TYPOGRAPHY
   ======================================== */

html {
  font-family: "Inter", sans-serif;
}

/* ========================================
   GOGYMIO — GLOBAL DESIGN TOKENS
   ======================================== */

:root {
  /* Brand */
  --color-primary-red: rgb(175 36 36);
  --color-dark-red: rgb(153 27 27);
  --color-graphite: rgb(31 31 31);
  --color-steel: rgb(122 122 122);
  --color-light-gray: rgb(210 210 210);

  /* Surfaces */
  --color-background: rgb(28 28 28);
  --color-sidebar: rgb(24 24 24);
  --color-card: rgb(18 18 18);
  --color-elevated: rgb(31 31 31);

  /* Text */
  --color-text-primary: rgb(235 235 235);
  --color-text-secondary: rgb(195 195 195);
  --color-text-muted: rgb(125 125 125);

  /* Borders */
  --color-border: rgb(55 55 55);
  --color-border-strong: rgb(70 70 70);
  --color-divider: rgb(55 55 55);

  /* Premium depth */
  --shadow-raised:
    5px 5px 12px rgb(0 0 0 / 70%), -3px -3px 8px rgb(255 255 255 / 3%);

  --shadow-raised-soft:
    3px 3px 8px rgb(0 0 0 / 65%), -2px -2px 6px rgb(255 255 255 / 3%);

  --shadow-inset:
    inset 3px 3px 7px rgb(0 0 0 / 75%),
    inset -2px -2px 5px rgb(255 255 255 / 3%);

  /* States */
  --color-success: rgb(34 170 82);
  --color-warning: rgb(220 145 10);
  --color-error: rgb(210 55 55);
  --color-info: rgb(55 115 200);

  /* Login */
  --color-login-page: rgb(31 31 31);
  --color-login-card: rgb(0 0 0);
  --color-login-input: rgb(15 15 15);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
}

/* ========================================
   GOGYMIO — GLOBAL BASE
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-4);

  background: var(--color-login-page);
}

.login-card {
  width: 100%;
  max-width: 25rem;

  padding: var(--space-8);

  background: var(--color-login-card);
  border: 1px solid rgb(45 45 45);
  border-radius: 12px;
}

.login-brand {
  display: flex;
  justify-content: center;

  margin-bottom: var(--space-6);
}

.login-logo {
  display: block;
  width: 16rem;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.login-heading {
  text-align: center;

  margin-bottom: var(--space-6);
}

.login-heading h1 {
  margin: 0;

  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;

  color: var(--color-text-primary);
}

.login-heading p {
  margin: var(--space-2) 0 0;

  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;

  color: var(--color-text-secondary);
}

/* ========================================
   FORM
   ======================================== */

#login-form {
  display: flex;
  flex-direction: column;

  gap: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;

  gap: var(--space-2);
}

.form-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;

  color: var(--color-text-secondary);
}

.form-field input {
  width: 100%;
  height: 2.75rem;

  padding: 0 var(--space-3);

  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;

  color: var(--color-text-primary);

  background: var(--color-login-input);
  border: 1px solid rgb(55 55 55);
  border-radius: 8px;

  outline: none;

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.form-field input::placeholder {
  color: var(--color-text-muted);
}

.form-field input:focus {
  border-color: var(--color-primary-red);

  box-shadow: 0 0 0 3px rgb(255 45 45 / 15%);
}

/* ========================================
   PASSWORD
   ======================================== */

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;

  top: 50%;
  right: var(--space-3);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 2rem;
  height: 2rem;

  padding: 0;

  color: var(--color-text-secondary);

  background: transparent;
  border: 0;

  cursor: pointer;

  transform: translateY(-50%);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--color-primary-red);
  outline-offset: 2px;
  border-radius: 4px;
}

.password-toggle svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 1.75;
}

/* ========================================
   LINKS
   ======================================== */

.login-options {
  display: flex;
  justify-content: flex-end;
}

.text-link {
  font-size: 0.8125rem;
  font-weight: 500;

  color: var(--color-text-secondary);
  text-decoration: none;
}

.text-link:active {
  color: var(--color-primary-red);
}

.text-link:focus-visible {
  outline: 2px solid var(--color-primary-red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ========================================
   BUTTONS
   ======================================== */

.button {
  min-height: 2.5rem;

  padding: 0 var(--space-4);

  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;

  border-radius: 8px;

  cursor: pointer;
}

.button-primary {
  color: var(--color-text-primary);

  background: var(--color-primary-red);
  border: 1px solid var(--color-primary-red);

  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.button-primary:active {
  background: var(--color-dark-red);
  border-color: var(--color-dark-red);
}

.button-primary:focus-visible {
  outline: 2px solid var(--color-primary-red);
  outline-offset: 3px;
}

.button-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-submit {
  width: 100%;

  margin-top: var(--space-2);
}

/* ========================================
   ERRORS
   ======================================== */

.form-error {
  min-height: 0;

  margin: 0;

  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;

  color: var(--color-error);
}

.login-form-error {
  text-align: center;
}

/* ========================================
   REGISTER
   ======================================== */

.login-register {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  gap: var(--space-1);

  margin-top: var(--space-6);

  font-size: 0.8125rem;
  line-height: 1.4;

  color: var(--color-text-muted);

  text-align: center;
}

/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 639px) {
  .login-page {
    padding: var(--space-4);
  }

  .login-card {
    padding: var(--space-6);
  }
}

/* ========================================
   MOBILE TAP HIGHLIGHT
   ======================================== */

button,
a,
input,
select,
textarea,
label {
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   NUMBER INPUT — HIDE BROWSER SPINNER
   ========================================================= */

.conversion-input-field[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.conversion-input-field[type="number"]::-webkit-inner-spin-button,
.conversion-input-field[type="number"]::-webkit-outer-spin-button {
  margin: 0;

  appearance: none;
  -webkit-appearance: none;
}

/* Toast CSS */
/* =========================================================
   TOAST NOTIFICATIONS
   Reusable user notification component
   Mobile-first / PWA safe
   ========================================================= */

/* ---------------------------------------------------------
   TOAST CONTAINER
   --------------------------------------------------------- */

.user-toast-container {
  position: fixed;

  /*
   * Keep the toast above:
   * - mobile navigation
   * - headers
   * - drawers
   * - dialogs
   * - PWA UI layers
   */
  z-index: 2147483000;

  display: flex;
  flex-direction: column;
  gap: 0.625rem;

  box-sizing: border-box;

  /*
   * Do not allow the container itself to block the page.
   */
  pointer-events: none;

  /*
   * Prevent unexpected width calculations on mobile.
   */
  width: calc(100vw - 1.5rem);
  max-width: 24rem;

  /*
   * Safe-area support for devices with display cutouts.
   */
  padding: 0;

  /*
   * Keep the container above the browser/PWA safe area.
   */
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

/* ---------------------------------------------------------
   TOP POSITIONS
   --------------------------------------------------------- */

.user-toast-container--top-left {
  top: 0.75rem;
  left: 0.75rem;
}

.user-toast-container--top-center {
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
}

.user-toast-container--top-right {
  top: 0.75rem;
  right: 0.75rem;
}

/* ---------------------------------------------------------
   BOTTOM POSITIONS
   --------------------------------------------------------- */

.user-toast-container--bottom-left {
  bottom: 0.75rem;
  left: 0.75rem;
}

.user-toast-container--bottom-center {
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
}

.user-toast-container--bottom-right {
  right: 0.75rem;
  bottom: 0.75rem;
}

/* ---------------------------------------------------------
   TOAST
   --------------------------------------------------------- */

.user-toast {
  width: 100%;
  min-width: 0;
  min-height: 3.5rem;

  display: flex;
  align-items: center;

  box-sizing: border-box;

  padding: 0.75rem 0.875rem;
  gap: 0.75rem;

  border: 1px solid rgb(65 65 65);
  border-radius: 0.75rem;

  background: rgb(28 28 28);
  color: rgb(235 235 235);

  box-shadow:
    5px 6px 12px rgb(0 0 0 / 70%),
    -2px -2px 6px rgb(255 255 255 / 3%);

  pointer-events: auto;

  /*
   * Prevent text and controls from overflowing
   * narrow mobile screens.
   */
  overflow: hidden;

  /*
   * Improve rendering on mobile browsers.
   */
  isolation: isolate;

  animation: user-toast-enter 180ms ease-out;
}

/* ---------------------------------------------------------
   ICON
   --------------------------------------------------------- */

.user-toast-icon {
  flex: 0 0 auto;

  width: 1.35rem;
  height: 1.35rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: rgb(175 36 36);
}

.user-toast-icon svg {
  width: 1.25rem;
  height: 1.25rem;

  stroke-width: 2.25;
}

/* ---------------------------------------------------------
   MESSAGE
   --------------------------------------------------------- */

.user-toast-message {
  min-width: 0;
  flex: 1 1 auto;

  color: rgb(235 235 235);

  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;

  /*
   * Important for long messages on narrow phones.
   */
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------------------------------------------------------
   CLOSE BUTTON
   --------------------------------------------------------- */

.user-toast-close {
  flex: 0 0 auto;

  width: 2rem;
  min-width: 2rem;

  height: 2rem;
  min-height: 2rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 0;
  border-radius: 0.5rem;

  background: transparent;
  color: rgb(125 125 125);

  cursor: pointer;

  /*
   * Prevent the browser from showing its default
   * mobile tap highlight.
   */
  -webkit-tap-highlight-color: transparent;

  /*
   * Better touch behavior.
   */
  touch-action: manipulation;

  transition:
    color 120ms ease,
    background 120ms ease;
}

.user-toast-close svg {
  width: 1rem;
  height: 1rem;

  stroke-width: 2.25;
}

/* ---------------------------------------------------------
   CLOSE BUTTON STATES
   --------------------------------------------------------- */

.user-toast-close:active {
  color: rgb(235 235 235);
  background: rgb(255 255 255 / 5%);
}

.user-toast-close:hover {
  color: rgb(235 235 235);
  background: rgb(255 255 255 / 5%);
}

.user-toast-close:focus-visible {
  outline: 2px solid rgb(175 36 36);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   TYPES
   --------------------------------------------------------- */

.user-toast--success {
  border-color: rgb(60 170 100);
}

.user-toast--success .user-toast-icon {
  color: rgb(60 170 100);
}

.user-toast--error {
  border-color: rgb(175 36 36);
}

.user-toast--error .user-toast-icon {
  color: rgb(220 70 70);
}

.user-toast--warning {
  border-color: rgb(210 155 55);
}

.user-toast--warning .user-toast-icon {
  color: rgb(225 175 70);
}

.user-toast--info {
  border-color: rgb(75 135 200);
}

.user-toast--info .user-toast-icon {
  color: rgb(95 155 220);
}

/* ---------------------------------------------------------
   ANIMATION
   --------------------------------------------------------- */

@keyframes user-toast-enter {
  from {
    opacity: 0;
    transform: translateY(-0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   BOTTOM POSITION ANIMATION
   --------------------------------------------------------- */

.user-toast-container--bottom-left .user-toast,
.user-toast-container--bottom-center .user-toast,
.user-toast-container--bottom-right .user-toast {
  animation-name: user-toast-enter-bottom;
}

@keyframes user-toast-enter-bottom {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .user-toast {
    animation: none;
  }
}

/* ---------------------------------------------------------
   TABLET / DESKTOP
   --------------------------------------------------------- */

@media (min-width: 40rem) {
  .user-toast-container {
    width: min(calc(100vw - 2rem), 26rem);
    max-width: 26rem;
  }

  .user-toast-container--top-left {
    top: 1rem;
    left: 1rem;
  }

  .user-toast-container--top-center {
    top: 1rem;
  }

  .user-toast-container--top-right {
    top: 1rem;
    right: 1rem;
  }

  .user-toast-container--bottom-left {
    bottom: 1rem;
    left: 1rem;
  }

  .user-toast-container--bottom-center {
    bottom: 1rem;
  }

  .user-toast-container--bottom-right {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 39.999rem) {
  /*
   * Full available mobile width minus safe side margins.
   */
  .user-toast-container {
    width: calc(100vw - 1.5rem);
    max-width: none;
  }

  /*
   * Use explicit left/right boundaries for top-right.
   *
   * This is intentional on mobile. It makes the container
   * behave as a full-width mobile notification region rather
   * than relying on width + right positioning.
   */
  .user-toast-container--top-right {
    top: calc(0.75rem + env(safe-area-inset-top));

    left: 0.75rem;
    right: 0.75rem;

    width: auto;
    max-width: none;

    transform: none;
  }

  .user-toast-container--top-left {
    top: calc(0.75rem + env(safe-area-inset-top));

    left: 0.75rem;
    right: 0.75rem;

    width: auto;
    max-width: none;
  }

  .user-toast-container--top-center {
    top: calc(0.75rem + env(safe-area-inset-top));

    left: 0.75rem;
    right: 0.75rem;

    width: auto;
    max-width: none;

    transform: none;
  }

  /*
   * Bottom notifications account for the mobile
   * safe-area inset.
   */
  .user-toast-container--bottom-right {
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));

    left: 0.75rem;

    width: auto;
    max-width: none;
  }

  .user-toast-container--bottom-left {
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));

    left: 0.75rem;

    width: auto;
    max-width: none;
  }

  .user-toast-container--bottom-center {
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));

    left: 0.75rem;

    width: auto;
    max-width: none;

    transform: none;
  }

  /*
   * Slightly larger touch target on phones.
   */
  .user-toast-close {
    width: 2.25rem;
    min-width: 2.25rem;

    height: 2.25rem;
    min-height: 2.25rem;
  }
}

/* ---------------------------------------------------------
   VERY SMALL PHONES
   --------------------------------------------------------- */

@media (max-width: 22rem) {
  .user-toast-container {
    left: 0.5rem;
    right: 0.5rem;

    width: auto;
  }

  .user-toast-container--top-left,
  .user-toast-container--top-center,
  .user-toast-container--top-right {
    left: 0.5rem;
    right: 0.5rem;
  }

  .user-toast-container--bottom-left,
  .user-toast-container--bottom-center,
  .user-toast-container--bottom-right {
    left: 0.5rem;
    right: 0.5rem;
  }

  .user-toast {
    padding: 0.7rem 0.75rem;
    gap: 0.625rem;
  }

  .user-toast-message {
    font-size: 0.8rem;
  }
}
