/* ================= RESET ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }

/* ================= VARIÁVEIS ================= */
:root{
  --rrios-blue:#003366;
  --rrios-orange:#f39200;
  --white:#ffffff;

  --text:#0f172a;
  --muted:#64748b;

  --radius:18px;
  --shadow: 0 30px 80px rgba(0,0,0,0.35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ring: 0 0 0 4px rgba(243,146,0,0.18);
}

/* ================= FUNDO ================= */
body{
  min-height:100vh;
  font-family:'Inter', sans-serif;
  color: var(--text);

  background:
    radial-gradient(1200px 600px at 10% 15%, rgba(243,146,0,0.18), transparent 60%),
    radial-gradient(900px 500px at 85% 25%, rgba(0,51,102,0.25), transparent 60%),
    linear-gradient(135deg, rgba(0, 51, 102, 0.70), rgba(0, 31, 63, 0.90)),
    url("images/backgl.png");
  background-size: cover;
  background-position: center;
  background-repeat:no-repeat;

  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
}

/* ================= CARD ================= */
.login-page{ width:100%; display:flex; justify-content:center; }

.login-box{
  width: min(440px, 100%);
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 34px 26px;
  position: relative;
  overflow: hidden;

  animation: popIn 0.85s var(--ease);
}

.login-box::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(700px 240px at 30% 0%, rgba(243,146,0,0.18), transparent 60%),
    radial-gradient(700px 240px at 90% 15%, rgba(0,51,102,0.14), transparent 55%);
  pointer-events:none;
}

/* ================= HEADER ================= */
.login-header{
  display:flex;
  align-items:center;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.login-logo{
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  padding: 10px;
}

.login-title h1{
  font-size: 1.35rem;
  color: var(--rrios-blue);
  font-weight: 900;
}
.login-title p{
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ================= FORM ================= */
.login-form{ margin-top: 6px; position: relative; z-index: 1; }

.field{ position: relative; margin-top: 14px; }

.field input{
  width: 100%;
  height: 52px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255,255,255,0.85);
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:hover{ border-color: rgba(15, 23, 42, 0.22); }

.field input:focus{
  border-color: rgba(243,146,0,0.9);
  box-shadow: var(--ring);
  background: rgba(255,255,255,1);
}

/* label flutuante */
.field label{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(100,116,139,0.95);
  font-size: 14px;
  pointer-events:none;
  transition: all 0.18s var(--ease);
  padding: 0 6px;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label{
  top: 0;
  transform: translateY(-55%);
  font-size: 12px;
  color: rgba(0,51,102,0.9);
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
}

/* senha com botão */
.field-password input{ padding-right: 96px; }

.toggle-pass{
  position:absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.92);
  color: rgba(15,23,42,0.82);
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border 0.15s ease;
}
.toggle-pass:hover{ transform: translateY(-50%) scale(1.02); border-color: rgba(15,23,42,0.18); }
.toggle-pass:active{ transform: translateY(-50%) scale(0.98); }

/* row */
.row{
  margin-top: 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.check{
  display:flex;
  align-items:center;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(15,23,42,0.78);
  user-select:none;
}
.check input{ width: 16px; height: 16px; accent-color: var(--rrios-orange); }

/* ================= BOTÃO ================= */
.primary-btn{
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  margin-top: 16px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: var(--white);

  background: linear-gradient(135deg, rgba(243,146,0,1), rgba(214,129,0,1));
  box-shadow: 0 18px 34px rgba(243,146,0,0.35);

  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.2s ease;

  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}

.primary-btn::before{
  content:"";
  position:absolute;
  top:-50%;
  left:-40%;
  width: 60%;
  height: 200%;
  background: rgba(255,255,255,0.22);
  transform: rotate(20deg);
  transition: left 0.5s var(--ease);
}
.primary-btn:hover::before{ left: 120%; }

.primary-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(243,146,0,0.42);
}
.primary-btn:active{
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(243,146,0,0.35);
}
.primary-btn:disabled{
  cursor:not-allowed;
  filter: grayscale(0.12) brightness(0.97);
  box-shadow: 0 10px 22px rgba(0,0,0,0.15);
}

/* spinner */
.btn-spinner{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  border-top-color: rgba(255,255,255,1);
  display:none;
  animation: spin 0.8s linear infinite;
}
.primary-btn.is-loading .btn-spinner{ display:inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= ERRO ================= */
.login-error{
  display:block;
  margin-top: 12px;
  font-size: 0.92rem;
  color: #c0392b;
  min-height: 20px;
}

.login-box.is-error{ animation: shake 0.28s ease-in-out; }
@keyframes shake{
  0%,100%{ transform: translateX(0); }
  25%{ transform: translateX(-7px); }
  50%{ transform: translateX(7px); }
  75%{ transform: translateX(-5px); }
}

/* ================= FOOTER ================= */
.login-footer{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.back-link{
  color: rgba(0,51,102,0.9);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.back-link:hover{
  opacity: 1;
  text-decoration: underline;
  transform: translateY(-1px);
}

.footnote{
  font-size: 0.82rem;
  color: rgba(100,116,139,0.9);
}

/* ================= ANIMAÇÃO ENTRADA ================= */
@keyframes popIn{
  from{ opacity:0; transform: translateY(18px) scale(0.985); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}

/* ================= ACESSIBILIDADE ================= */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}
