:root {
  --bg: #ebebeb;
  --stage: #111216;
  --stage-2: #15171d;
  --line: rgba(255, 255, 255, 0.06);
  --line-soft: rgba(255, 255, 255, 0.04);

  --text: #f5f7fb;
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.42);

  --input-bg: rgba(255, 255, 255, 0.018);
  --input-border: rgba(255, 255, 255, 0.055);
  --input-border-hover: rgba(255, 255, 255, 0.09);
  --input-border-focus: rgba(255, 255, 255, 0.16);

  --white: #ffffff;
  --dark-text: #111216;

  --danger-bg: rgba(255, 110, 110, 0.08);
  --danger-border: rgba(255, 110, 110, 0.18);
  --danger-text: #ffc1c1;

  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --shadow-stage:
    0 40px 90px rgba(0, 0, 0, 0.18), 0 10px 30px rgba(0, 0, 0, 0.08);

  --transition: 0.18s ease;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input {
  font: inherit;
}

/* =========================
   PAGE
========================= */
.login-page {
  min-height: 100vh;
  padding: 0;
}

.auth-shell {
  width: 100%;
  height: 100vh;
}

.auth-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  /* border-radius: 22px; */
  overflow: hidden;
  background:
    radial-gradient(
      circle at 14% 86%,
      rgba(255, 255, 255, 0.22),
      transparent 20%
    ),
    radial-gradient(
      circle at 88% 12%,
      rgba(255, 255, 255, 0.2),
      transparent 22%
    ),
    radial-gradient(
      circle at 60% 24%,
      rgba(59, 91, 255, 0.09),
      transparent 18%
    ),
    linear-gradient(90deg, #14151a 0%, #101116 47%, #15161b 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-stage);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  isolation: isolate;
}

.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.02),
      transparent 28%,
      transparent 72%,
      rgba(255, 255, 255, 0.03)
    ),
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.015),
      transparent 56%
    );
  pointer-events: none;
  z-index: -1;
}

.auth-stage::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, 0.025);
  pointer-events: none;
  z-index: -1;
}

/* =========================
   BACK
========================= */
.auth-back {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition:
    opacity var(--transition),
    transform var(--transition),
    color var(--transition);
}

.auth-back:hover {
  color: var(--white);
  transform: translateX(-1px);
}

.auth-back-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-back-icon svg {
  width: 13px;
  height: 13px;
}

/* =========================
   CENTER
========================= */
.auth-center {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-brand {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
}

.auth-brand-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at center,
      transparent 34%,
      rgba(255, 255, 255, 0.88) 35%,
      rgba(255, 255, 255, 0.88) 44%,
      transparent 45%
    ),
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0.92) 0deg 10deg,
      rgba(255, 255, 255, 0.18) 10deg 20deg
    );
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
}

.auth-header h1 {
  margin: 0;
  font-size: clamp(27px, 2vw, 38px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.045em;
  color: #ffffff;
}

.auth-header p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.auth-header p a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.auth-header p a:hover {
  color: #ffffff;
}

/* =========================
   ERROR
========================= */
.auth-error {
  width: 100%;
  margin: 20px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

/* =========================
   FORM
========================= */
.auth-form {
  width: 100%;
  margin-top: 22px;
}

.field {
  text-align: left;
  margin-bottom: 10px;
}

.field label {
  display: none;
}

.field input {
  width: 100%;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: #ffffff;
  padding: 0 14px;
  outline: none;
  font-size: 13px;
  font-weight: 400;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.22);
}

.field input:hover {
  border-color: var(--input-border-hover);
  background: rgba(255, 255, 255, 0.024);
}

.field input:focus {
  border-color: var(--input-border-focus);
  background: rgba(255, 255, 255, 0.028);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.02),
    0 10px 28px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.btn-primary,
.btn-secondary {
  width: 100%;
  height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.btn-primary {
  margin-top: 12px;
  border: none;
  background: #f5f5f5;
  color: var(--dark-text);
  box-shadow:
    0 10px 22px rgba(255, 255, 255, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.magic-link {
  margin-top: 14px;
  display: inline-block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  transition:
    color var(--transition),
    opacity var(--transition);
}

.magic-link:hover {
  color: #ffffff;
}

.divider {
  position: relative;
  margin: 18px 0 14px;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateY(-50%);
}

.divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: transparent;
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.012);
  color: rgba(255, 255, 255, 0.88);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.022);
  transform: translateY(-1px);
}

/* =========================
   FOOTER
========================= */
.auth-footer {
  margin-top: 18px;
}

.auth-footer p {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.34);
}

.auth-footer a {
  color: rgba(255, 255, 255, 0.56);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-footer a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* =========================
   AUTOFILL
========================= */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.02) inset;
  border: 1px solid var(--input-border-focus);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
  .login-page {
    padding: 14px;
  }

  .auth-shell,
  .auth-stage {
    min-height: calc(100vh - 28px);
  }

  .auth-stage {
    padding: 26px 18px;
    border-radius: 20px;
  }

  .auth-stage::after {
    border-radius: 19px;
  }

  .auth-back {
    top: 14px;
    left: 14px;
  }

  .auth-center {
    max-width: 340px;
  }
}

@media (max-width: 520px) {
  .login-page {
    padding: 10px;
  }

  .auth-shell,
  .auth-stage {
    min-height: calc(100vh - 20px);
  }

  .auth-stage {
    border-radius: 18px;
    padding: 22px 14px;
  }

  .auth-stage::after {
    border-radius: 17px;
  }

  .auth-brand {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin-bottom: 18px;
  }

  .auth-brand-ring {
    width: 22px;
    height: 22px;
  }

  .auth-header h1 {
    font-size: 24px;
  }

  .auth-header p {
    font-size: 12px;
  }

  .field input,
  .btn-primary,
  .btn-secondary {
    height: 40px;
    font-size: 12.5px;
    border-radius: 12px;
  }

  .magic-link {
    font-size: 11.5px;
  }

  .auth-footer p {
    font-size: 10.5px;
  }
}

.remember {
  margin-top: 14px;
  text-align: center;
}

.remember p {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.01em;
}

.remember a {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}

/* efeito underline premium */
.remember a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  transform: scaleX(0);
  transform-origin: left;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.remember a:hover {
  color: #ffffff;
}

.remember a:hover::after {
  transform: scaleX(1);
  background: rgba(255, 255, 255, 0.6);
}
