* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.card {
  position: relative;
  overflow: hidden;
  width: 660px;
  max-width: 92vw;
  height: 520px;
  border-radius: 24px;
  background: #ffffff;
  border: 8px solid #ffffff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
}

.toggle {
  display: none;
}

.card-bg {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(180deg, rgba(20, 20, 25, 0) 0%, rgba(10, 10, 15, 0.55) 100%),
    linear-gradient(160deg, #ffb37a 0%, #e77b5c 22%, #7a5470 45%, #3c3b56 65%, #1c1c2b 85%, #0c0c14 100%);
  /* troque por: background: url("../images/hero.jpg") center/cover no-repeat; quando tiver a imagem */
  border-radius: 18px;
  translate: 100% 0;
  transition: 0.65s ease-in-out;
}

.toggle:checked ~ .card-bg {
  translate: 0 0;
}

.hero,
.form {
  position: absolute;
  width: 50%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: 0.65s ease-in-out;
}

.hero.login,
.form.login {
  opacity: 1;
  visibility: visible;
}

.toggle:checked ~ :is(.hero, .form).login {
  opacity: 0;
  visibility: hidden;
}

.toggle:checked ~ :is(.hero, .form).register {
  opacity: 1;
  visibility: visible;
}

/* hero acompanha o lado onde a foto está */
.hero.login {
  left: 50%;
  translate: 0 0;
}

.toggle:checked ~ .hero.login {
  translate: 100% 0;
}

.hero.register {
  left: 0;
  translate: -100% 0;
}

.toggle:checked ~ .hero.register {
  translate: 0 0;
}

.hero {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #f9f9f9;
  text-align: center;
  padding: 0 24px;
}

.hero h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.hero p {
  margin: 0 0 6px;
  opacity: 0.85;
  line-height: 1.45;
  font-size: 14px;
}

.hero label {
  cursor: pointer;
  padding: 12px 40px;
  border-radius: 32px;
  letter-spacing: 1px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #f9f9f9;
  background: rgb(255 255 255 / 4%);
  backdrop-filter: blur(4px);
  transition: 0.3s;
}

.hero label:hover {
  color: #212625;
  background: #f9f9f9;
}

/* form ocupa o lado oposto ao da foto */
.form.login {
  left: 0;
  translate: 0 0;
}

.toggle:checked ~ .form.login {
  translate: 100% 0;
}

.form.register {
  left: 50%;
  translate: -100% 0;
}

.toggle:checked ~ .form.register {
  translate: 0 0;
}

.form {
  z-index: 1;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form h2 {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: #6b6b6b;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: #f2f2f2;
  font-size: 14px;
  color: #1a1a1a;
  outline: none;
  transition: box-shadow 0.2s;
}

.field input:focus {
  box-shadow: 0 0 0 2px #1a1a1a;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #6b6b6b;
  margin-bottom: 24px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-between a {
  color: #6b6b6b;
  text-decoration: none;
}

.row-between a:hover {
  text-decoration: underline;
}

.submit-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: #333;
}

@media (max-width: 600px) {
  .card {
    width: 100%;
    height: auto;
    min-height: 460px;
  }

  .card-bg,
  .hero {
    display: none;
  }

  .form {
    position: relative;
    width: 100%;
    opacity: 1;
    visibility: visible;
    translate: 0 0 !important;
    left: 0 !important;
  }

  .form.register {
    display: none;
  }

  .toggle:checked ~ .form.login {
    display: none;
  }

  .toggle:checked ~ .form.register {
    display: flex;
  }

  .mobile-switch {
    display: block;
    margin-top: 4px;
    text-align: center;
    font-size: 13px;
    color: #6b6b6b;
  }

  .mobile-switch label {
    cursor: pointer;
    color: #1a1a1a;
    font-weight: 600;
  }
}

.mobile-switch {
  display: none;
}

.form.register .submit-btn {
  margin-top: 4px;
}

.remember label {
  margin: 0;
}
