/* login.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  background: #0d1b2a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Helper */
.d-none {
  display: none !important;
}

/* ====== SLIDESHOW BACKGROUND ====== */
.background-slideshow,
.slideshow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.slideshow {
  list-style: none;
  margin: 0;
  padding: 0;
}

.slideshow li {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slideshow li span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: 50% 50%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  animation: imageAnimation 198s linear infinite;
  will-change: opacity;
}

@keyframes imageAnimation {
  0% { opacity: 0; animation-timing-function: ease-in; }
  3% { opacity: 1; animation-timing-function: ease-out; }
  8% { opacity: 1; }
  11% { opacity: 0; }
  100% { opacity: 0; }
}

/* ====== MAIN LAYOUT ====== */
.main-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
  z-index: 2;
}

.login-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
}

/* ====== LOGIN CARD ====== */
.card {
  width: 100%;
  max-width: 520px;
  padding: 64px 48px;
  border-radius: 18px;
  background: rgba(20, 20, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.65);
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* ====== TITULO / LOGO "Ŝtono" ====== */
.stono-container {
  text-align: center;
  width: 100%;
}

.stono-title {
  font-weight: 700;
  color: #fff;
  font-size: 3.2rem;
  line-height: 1;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
  text-align: center;
  z-index: 3;
}

.stono-title::after {
  content: "";
  display: block;
  width: 96px;
  height: 4px;
  background: #9ca3af;
  margin: 14px auto 0;
  border-radius: 3px;
}

/* ====== FORM ====== */
form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-group input {
  width: 100%;
  height: 54px;
  padding: 12px 44px 12px 48px;
  font-size: 1rem;
  color: #0b1720;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  border: none;
  outline: none;
  transition: box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
  -webkit-appearance: none;
  position: relative;
  z-index: 1;
}

.input-group input:focus {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.input-group input::placeholder {
  color: #9aa4ac;
}

.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 2;
}

.input-group:focus-within .input-icon {
  color: #6b7280;
  transform: translateY(-50%) scale(1.1);
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.45);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  z-index: 3;
}

.btn-toggle-password:hover {
  color: #ff4d6d;
}

/* ====== SWITCH (remember me) ====== */
.switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: flex-start;
  margin-top: 6px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  transition: 220ms;
}

.slider:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: 220ms;
}

.switch input:checked + .slider {
  background: linear-gradient(90deg, #ff4d6d, #c9184a);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.switch-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

/* ====== BOTÓN ====== */
.btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  font-size: 1.03rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #4b5563, #1f2933);
  transition: transform 180ms ease, opacity 140ms, filter 180ms ease;
  animation: glowShift 100s infinite linear;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.15);
  animation-duration: 2s;
}

@keyframes glowShift {
  0% { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.6); }
  20% { box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6); }
  40% { box-shadow: 0 10px 30px rgba(234, 179, 8, 0.6); }
  60% { box-shadow: 0 10px 30px rgba(239, 68, 68, 0.6); }
  80% { box-shadow: 0 10px 30px rgba(168, 85, 247, 0.6); }
  100% { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.6); }
}

/* ====== ERROR MESSAGE (Unificado y optimizado) ====== */
.error-message {
  width: 100%;
  background-color: rgba(220, 53, 69, 0.1);
  border-left: 4px solid #dc3545;
  color: #dc3545;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
  
  /* Estado inicial oculto con transición suave */
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.error-message.show {
  opacity: 1;
  max-height: 100px;
}

.close-error {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.close-error:hover {
  opacity: 1;
}

/* ====== LOADING ====== */
#loading-animation {
  width: 100%;
  text-align: center;
  margin-top: 6px;
  color: #fff;
}

#loading-animation .loader-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top: 4px solid #d1d5db;
  border-right: 4px solid #9ca3af;
  animation: loaderSpin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

/* ====== FOOTER ====== */
.footer {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  z-index: 5;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.footer a {
  color: #fff;
  font-weight: 600;
}

/* ====== FORGOT PASSWORD ====== */
.forgot-password-container {
  text-align: right;
  margin: 10px 0 20px;
}

.forgot-password-container a {
  color: #1976d2;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color .2s;
}

.forgot-password-container a:hover {
  color: #0d47a1;
  text-decoration: underline;
}

/* ====== ANIMACIÓN DE ERROR (SHAKE) ====== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* ====== LISTADO DE IMÁGENES (Slideshow) ====== */
.slideshow li:nth-child(1) span { background-image: url('/img/login_imgs/481257690_1373802190702031_2200602030685126219_n.webp'); animation-delay: 0s; }
.slideshow li:nth-child(2) span { background-image: url('/img/login_imgs/481821971_1377733510308899_3623405961791753902_n.webp'); animation-delay: 6s; }
.slideshow li:nth-child(3) span { background-image: url('/img/login_imgs/481916538_1377723280309922_3217787811778759473_n.webp'); animation-delay: 12s; }
.slideshow li:nth-child(4) span { background-image: url('/img/login_imgs/481920335_1377593906989526_6607384762626997083_n.webp'); animation-delay: 18s; }
.slideshow li:nth-child(5) span { background-image: url('/img/login_imgs/481956514_1377603680321882_9070958213082293193_n.webp'); animation-delay: 24s; }
.slideshow li:nth-child(6) span { background-image: url('/img/login_imgs/481958165_1376545253761058_1246451322360688174_n.webp'); animation-delay: 30s; }
.slideshow li:nth-child(7) span { background-image: url('/img/login_imgs/481989131_1378740006874916_7234119580577956342_n.webp'); animation-delay: 36s; }
.slideshow li:nth-child(8) span { background-image: url('/img/login_imgs/482222862_1381501046598812_4736089915123166098_n.webp'); animation-delay: 42s; }
.slideshow li:nth-child(9) span { background-image: url('/img/login_imgs/482236779_1379023223513261_14000461697800864_n.webp'); animation-delay: 48s; }
.slideshow li:nth-child(10) span { background-image: url('/img/login_imgs/482242897_1379549806793936_8205694533019660511_n.webp'); animation-delay: 54s; }
.slideshow li:nth-child(11) span { background-image: url('/img/login_imgs/482267815_1380910539991196_3025417645084913758_n.webp'); animation-delay: 60s; }
.slideshow li:nth-child(12) span { background-image: url('/img/login_imgs/482326678_1378283450253905_8104991680619345202_n.webp'); animation-delay: 66s; }
.slideshow li:nth-child(13) span { background-image: url('/img/login_imgs/482353860_1375153113900272_1428834142398470585_n.webp'); animation-delay: 72s; }
.slideshow li:nth-child(14) span { background-image: url('/img/login_imgs/483734422_1382573009824949_284889967095928569_n.webp'); animation-delay: 78s; }
.slideshow li:nth-child(15) span { background-image: url('/img/login_imgs/484177193_1382578196491097_6487070529427885511_n.webp'); animation-delay: 84s; }
.slideshow li:nth-child(16) span { background-image: url('/img/login_imgs/484741572_1385779222837661_6717196022790260576_n.webp'); animation-delay: 90s; }
.slideshow li:nth-child(17) span { background-image: url('/img/login_imgs/485143462_1385482099534040_2299473695522426936_n.webp'); animation-delay: 96s; }
.slideshow li:nth-child(18) span { background-image: url('/img/login_imgs/485355723_1385779156171001_6246892635251458568_n.webp'); animation-delay: 102s; }
.slideshow li:nth-child(19) span { background-image: url('/img/login_imgs/488614158_1404094257672824_7349975140984577364_n.webp'); animation-delay: 108s; }
.slideshow li:nth-child(20) span { background-image: url('/img/login_imgs/488618596_1404112887670961_6017451817494035790_n.webp'); animation-delay: 114s; }
.slideshow li:nth-child(21) span { background-image: url('/img/login_imgs/488643099_1402591797823070_1709577811827796155_n.webp'); animation-delay: 120s; }
.slideshow li:nth-child(22) span { background-image: url('/img/login_imgs/488894605_1404112894337627_7406950712754029329_n.webp'); animation-delay: 126s; }
.slideshow li:nth-child(23) span { background-image: url('/img/login_imgs/488938259_1404112904337626_8154270921247117693_n.webp'); animation-delay: 132s; }
.slideshow li:nth-child(24) span { background-image: url('/img/login_imgs/489025624_1404094274339489_567191623580039044_n.webp'); animation-delay: 138s; }
.slideshow li:nth-child(25) span { background-image: url('/img/login_imgs/489026912_1404113324337584_4332813457444199533_n.webp'); animation-delay: 144s; }
.slideshow li:nth-child(26) span { background-image: url('/img/login_imgs/489075327_1404729867609263_8643555250607677393_n.webp'); animation-delay: 150s; }
.slideshow li:nth-child(27) span { background-image: url('/img/login_imgs/489289950_1404729480942635_5879722249213423168_n.webp'); animation-delay: 156s; }
.slideshow li:nth-child(28) span { background-image: url('/img/login_imgs/489521265_1404729874275929_1708165484040272012_n.webp'); animation-delay: 162s; }
.slideshow li:nth-child(29) span { background-image: url('/img/login_imgs/489628760_1405860737496176_887886277048957975_n.webp'); animation-delay: 168s; }
.slideshow li:nth-child(30) span { background-image: url('/img/login_imgs/489778327_1406670484081868_1254931398580228870_n.webp'); animation-delay: 174s; }
.slideshow li:nth-child(31) span { background-image: url('/img/login_imgs/489838810_1406372267445023_7264854530872996967_n.webp'); animation-delay: 180s; }
.slideshow li:nth-child(32) span { background-image: url('/img/login_imgs/489858098_1406928267389423_7383213114127795716_n.webp'); animation-delay: 186s; }
.slideshow li:nth-child(33) span { background-image: url('/img/login_imgs/490281696_1405860487496201_6288497647042954897_n.webp'); animation-delay: 192s; }

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
  .card {
    padding: 56px 34px;
    max-width: 760px;
  }
  .stono-title {
    font-size: 2.8rem;
  }
}

@media (max-width: 600px) {
  .card {
    padding: 34px 22px;
    max-width: 92%;
  }
  .stono-title {
    font-size: 2.4rem;
  }
  .input-group input {
    height: 52px;
    padding-right: 48px;
  }
  .btn {
    padding: 12px;
    font-size: 1rem;
  }
}