* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #07111c;
  --color-bg-deep: #040912;
  --color-bg-panel: #0b1626;
  --color-card: rgba(10, 19, 34, 0.86);
  --color-card-soft: rgba(13, 24, 41, 0.78);
  --color-card-border: rgba(255, 255, 255, 0.08);

  --color-text: #f8fafc;
  --color-text-soft: rgba(226, 232, 240, 0.74);
  --color-label: #d9e2ec;

  --color-input: rgba(255, 255, 255, 0.055);
  --color-input-hover: rgba(255, 255, 255, 0.075);
  --color-input-border: rgba(255, 255, 255, 0.1);
  --color-input-focus: rgba(197, 48, 55, 0.18);

  --color-primary: #0f2747;
  --color-primary-strong: #15345f;
  --color-accent: #c53037;
  --color-accent-strong: #e03a3e;
  --color-accent-soft: rgba(197, 48, 55, 0.14);

  --color-danger-bg: rgba(197, 48, 55, 0.14);
  --color-danger-border: rgba(224, 58, 62, 0.28);
  --color-danger-text: #ffd7d9;

  --shadow-main: 0 28px 70px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.26);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: "Inter", sans-serif;
  background: var(--color-bg-deep);
  color: var(--color-text);
  overflow: hidden;
}

body {
  min-height: 100vh;
}

.login-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 20% 28%,
      rgba(24, 83, 153, 0.22),
      transparent 24%
    ),
    radial-gradient(circle at 78% 82%, rgba(197, 48, 55, 0.1), transparent 20%),
    linear-gradient(135deg, #040912 0%, #07111c 40%, #0a1730 100%);
}

/* Fundo base com leve profundidade */
.background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.008) 12%,
    rgba(255, 255, 255, 0) 24%,
    rgba(255, 255, 255, 0.014) 36%,
    rgba(255, 255, 255, 0) 48%,
    rgba(255, 255, 255, 0.012) 60%,
    rgba(255, 255, 255, 0) 72%,
    rgba(255, 255, 255, 0.01) 84%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0.4;
}

/* Glow azul grande do lado esquerdo, como na referência */
.background-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    circle at 16% 32%,
    rgba(46, 148, 255, 0.28) 0%,
    rgba(46, 148, 255, 0.18) 18%,
    rgba(46, 148, 255, 0.08) 32%,
    rgba(46, 148, 255, 0) 52%
  );
  opacity: 0.95;
}

/* Pattern geométrico do lado direito */
.login-page::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 42%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%2349b4ff' stroke-width='1.5' stroke-opacity='0.55'%3E%3Cpath d='M60 18 L74 26 L82 40 L74 54 L60 62 L46 54 L38 40 L46 26 Z'/%3E%3Cpath d='M18 18 L32 26 L40 40 L32 54 L18 62 L4 54 L-4 40 L4 26 Z'/%3E%3Cpath d='M102 18 L116 26 L124 40 L116 54 L102 62 L88 54 L80 40 L88 26 Z'/%3E%3Cpath d='M60 58 L74 66 L82 80 L74 94 L60 102 L46 94 L38 80 L46 66 Z'/%3E%3Cpath d='M18 58 L32 66 L40 80 L32 94 L18 102 L4 94 L-4 80 L4 66 Z'/%3E%3Cpath d='M102 58 L116 66 L124 80 L116 94 L102 102 L88 94 L80 80 L88 66 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 118px 118px;
  background-repeat: repeat;
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 16%,
    rgba(0, 0, 0, 1) 42%,
    rgba(0, 0, 0, 1) 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 16%,
    rgba(0, 0, 0, 1) 42%,
    rgba(0, 0, 0, 1) 100%
  );
}

/* brilho suave sobre o pattern */
.login-page::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 38%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(36, 127, 212, 0.05) 28%,
    rgba(36, 127, 212, 0.08) 60%,
    rgba(36, 127, 212, 0.03) 100%
  );
  opacity: 0.8;
}

/* glows complementares */
.background-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(110px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.28;
}

.background-glow--left {
  width: 300px;
  height: 300px;
  left: -60px;
  bottom: -80px;
  background: rgba(29, 113, 206, 0.28);
}

.background-glow--right {
  width: 260px;
  height: 260px;
  right: -50px;
  bottom: -40px;
  background: rgba(197, 48, 55, 0.12);
}

/* círculos finos decorativos */
.login-wrapper::before {
  content: "";
  position: fixed;
  top: -40px;
  right: -30px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1;
  pointer-events: none;
}

.login-wrapper::after {
  content: "";
  position: fixed;
  left: -110px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(197, 48, 55, 0.08);
  z-index: 1;
  pointer-events: none;
}

.login-wrapper {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 42px 38px 34px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.01)
    ),
    linear-gradient(135deg, rgba(9, 17, 31, 0.94), rgba(11, 22, 38, 0.88));
  border: 1px solid var(--color-card-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-main);
  overflow: hidden;
  animation: fadeUp 0.7s ease;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.015)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    130deg,
    transparent 0%,
    rgba(255, 255, 255, 0.022) 52%,
    transparent 100%
  );
  pointer-events: none;
}

.login-card__glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(46px);
  pointer-events: none;
}

.login-card__glow--blue {
  width: 170px;
  height: 170px;
  top: -48px;
  left: -40px;
  background: rgba(21, 52, 95, 0.24);
}

.login-card__glow--green {
  width: 150px;
  height: 150px;
  right: -36px;
  bottom: -42px;
  background: rgba(197, 48, 55, 0.15);
}

.login-header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 28px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-avatar {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.login-title {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 10px;
}

.login-subtitle {
  max-width: 320px;
  margin: 0 auto;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--color-text-soft);
}

.login-form {
  position: relative;
  z-index: 2;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-label);
}

.form-group input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  background: var(--color-input);
  color: #ffffff;
  font-size: 0.97rem;
  outline: none;
  transition: all 0.22s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.form-group input::placeholder {
  color: rgba(226, 232, 240, 0.42);
}

.form-group input:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--color-input-hover);
}

.form-group input:focus {
  border-color: rgba(224, 58, 62, 0.45);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 4px var(--color-input-focus),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.error-message {
  margin: 6px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-button {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(90deg, #0f2747 0%, #c53037 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow:
    0 10px 24px rgba(21, 52, 95, 0.2),
    0 8px 20px rgba(197, 48, 55, 0.18);
}

.login-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(90deg, #15345f 0%, #e03a3e 100%);
  box-shadow:
    0 14px 28px rgba(21, 52, 95, 0.24),
    0 10px 24px rgba(197, 48, 55, 0.22);
}

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

.logo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    rgba(11, 22, 38, 0.96),
    rgba(4, 9, 18, 0.985)
  );
  transition:
    opacity 0.7s ease,
    visibility 0.7s ease;
}

.logo-overlay.hide {
  opacity: 0;
  visibility: hidden;
}

.logo-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.logo-overlay__logo {
  width: 110px;
  max-width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.logo-overlay__text {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #dbe4ef;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

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

@media (max-width: 900px) {
  .login-page::before {
    width: 50%;
    opacity: 0.11;
    background-size: 96px 96px;
  }

  .background-grid {
    background: radial-gradient(
      circle at 18% 25%,
      rgba(46, 148, 255, 0.22) 0%,
      rgba(46, 148, 255, 0.12) 20%,
      rgba(46, 148, 255, 0) 48%
    );
  }
}

@media (max-width: 640px) {
  .login-wrapper {
    padding: 18px;
  }

  .login-card {
    padding: 30px 22px 24px;
    border-radius: 22px;
  }

  .login-title {
    font-size: 1.7rem;
  }

  .login-subtitle {
    font-size: 0.92rem;
  }

  .login-avatar {
    width: 74px;
    height: 74px;
  }

  .form-group input,
  .login-button {
    height: 48px;
  }

  .login-page::before {
    width: 58%;
    opacity: 0.09;
    background-size: 82px 82px;
  }

  .login-wrapper::before {
    width: 160px;
    height: 160px;
    top: -35px;
    right: -45px;
  }

  .login-wrapper::after {
    width: 220px;
    height: 220px;
    left: -95px;
    bottom: -95px;
  }
}
