:root {
  --page-bg: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.92);
  --text: #0b1b35;
  --text-soft: #52627a;
  --muted: #78869a;
  --border: #dce3ec;
  --border-hover: #bac7d8;
  --focus: rgba(101, 172, 222, 0.20);
  --blue: #2f75df;
  --blue-dark: #155cc8;
  --aqua: #42c7c8;
  --danger: #c92a2a;
  --danger-bg: #fff3f3;
  --danger-border: #ffd2d2;
  --shadow-card: 0 18px 50px rgba(29, 53, 87, 0.10);
  --shadow-button: 0 13px 28px rgba(50, 134, 220, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 16% -10%, rgba(101, 172, 222, 0.28), transparent 34%),
    radial-gradient(circle at 52% -17%, rgba(var(--valora-visual-accent-rgb, 75, 195, 199), 0.17), transparent 31%),
    radial-gradient(circle at 93% -10%, rgba(250, 177, 164, 0.25), transparent 33%),
    linear-gradient(180deg, #f8fbff 0, #ffffff 32%, #ffffff 100%);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

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

.hidden {
  display: none !important;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 44px 22px 30px;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.24), transparent 34%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 414px);
  margin: auto;
}

.login-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 26px;
}

.login-logo {
  display: block;
  width: 150px;
  height: auto;
  max-width: 100%;
  margin: 0 auto 42px;
  object-fit: contain;
  object-position: center;
}

.login-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(23px, 3vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.login-header p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}

.login-card {
  width: 100%;
  padding: 27px;
  border: 1px solid rgba(218, 226, 236, 0.90);
  border-radius: 15px;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.provider-list {
  display: grid;
  gap: 12px;
}

.provider-button {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 600;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.provider-button::after {
  content: "";
  width: 24px;
}

.provider-button:hover {
  border-color: var(--border-hover);
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(29, 53, 87, 0.07);
  transform: translateY(-1px);
}

.provider-button:focus-visible,
.eye-btn:focus-visible,
.back-btn:focus-visible,
.login-submit:focus-visible,
.login-links a:focus-visible,
.login-help a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.provider-button > i {
  justify-self: start;
  color: #3a587b;
  font-size: 15px;
}

.provider-google > i {
  color: #4285f4;
  font-size: 17px;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 25px 0 22px;
}

.login-divider span {
  height: 1px;
  background: #e1e6ed;
}

.login-divider small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin: 0 0 7px;
  color: #34435a;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
}

.input-box {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.input-box:focus-within {
  border-color: #74aee5;
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--focus);
}

.input-box input,
.input-box select {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 0 !important;
  outline: 0 !important;
  color: var(--text);
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
}

.input-box input::placeholder {
  color: #9aa6b6;
  opacity: 1;
  font-weight: 400;
}

.input-box select {
  appearance: none;
  cursor: pointer;
  padding-right: 4px;
}

.select-box > i {
  flex: 0 0 auto;
  margin-right: 14px;
  color: #7f8da0;
  font-size: 10px;
  pointer-events: none;
}

.password-box input {
  padding-right: 6px;
}

.eye-btn {
  width: 42px;
  height: 42px;
  margin-right: 2px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #718096;
  background: transparent;
  transition: color 160ms ease, background 160ms ease;
}

.eye-btn:hover {
  color: var(--text);
  background: #f3f6fa;
}

.remember-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(100deg, #2568d8 0%, #398de2 48%, #41c7c6 100%);
  box-shadow: var(--shadow-button);
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 16px 31px rgba(50, 134, 220, 0.30);
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.login-links {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-links a {
  color: var(--blue);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  transition: color 160ms ease;
}

.login-links a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error-box {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--danger-border);
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

.token-message {
  margin-bottom: 18px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(var(--valora-visual-accent-rgb, 75, 195, 199), 0.20);
  border-radius: 11px;
  background: rgba(var(--valora-visual-accent-rgb, 75, 195, 199), 0.09);
}

.token-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #188f95;
  background: #ffffff;
  box-shadow: 0 5px 12px rgba(30, 117, 123, 0.09);
}

.token-message strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.token-message p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.token-input-box input {
  text-align: center;
  letter-spacing: 7px;
  font-size: 18px;
  font-weight: 700;
}

.back-btn {
  margin: 0 0 16px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--text-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.back-btn:hover {
  color: var(--blue-dark);
}

.login-help {
  margin-top: 28px;
  text-align: center;
}

.login-help a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #718096;
  font-size: 12px;
  font-weight: 500;
  transition: color 160ms ease;
}

.login-help a:hover {
  color: var(--blue-dark);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 9999s ease-in-out 0s !important;
}

@media (max-height: 790px) and (min-width: 641px) {
  .login-page {
    place-items: start center;
    padding-top: 28px;
  }

  .login-logo {
    width: 150px;
    height: 84px;
    margin-bottom: 0;
  }

  .login-header {
    margin-bottom: 18px;
  }

  .login-card {
    padding: 23px 25px;
  }

  .provider-button,
  .input-box,
  .login-submit {
    min-height: 43px;
  }

  .input-box input,
  .input-box select {
    height: 41px;
  }

  .login-divider {
    margin: 19px 0 17px;
  }

  .form-field {
    margin-bottom: 13px;
  }

  .login-help {
    margin-top: 19px;
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 8% -2%, rgba(101, 172, 222, 0.25), transparent 37%),
      radial-gradient(circle at 94% -4%, rgba(250, 177, 164, 0.20), transparent 36%),
      #ffffff;
  }

  .login-page {
    align-items: start;
    padding: 28px 16px 26px;
  }

  .login-shell {
    width: min(100%, 420px);
  }

  .login-logo {
    width: 154px;
    height: 87px;
  }

  .login-header {
    margin-bottom: 21px;
  }

  .login-header h1 {
    font-size: 23px;
  }

  .login-card {
    padding: 22px 18px;
    border-radius: 13px;
  }

  .provider-button {
    min-height: 45px;
  }

  .login-links {
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .login-page {
    padding-inline: 11px;
  }

  .login-card {
    padding-inline: 15px;
  }

  .login-links {
    flex-direction: column;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
