:root {
    --footerH: 34px; /* ajusta si tu footer es más alto */
    --pagePad: 48px; /* aire total arriba/abajo */
    --panelMinH: 600px; /* prueba 600, si quieres más bajo: 580 */
}

html, body {
    height: 100%;
}

body {
    font-family: "Montserrat", sans-serif;
    background: #f7edd5;
    /* en vez de height:100vh */
    min-height: 100svh; /* mejor que 100vh (incluye barras del navegador) */
    display: flex;
    flex-direction: column;
    /* NO lo escondas, si algo no cabe debe poder ajustar */
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
  max-width: 800px;
}

a {
    display: inline-block;
    text-decoration: none;
    color: rgb(0, 150, 64);
}

input {
  outline: none !important;
}

h1 {
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 40px;
  font-weight: 700;
}

.brand {
    padding: 20px;
    background: url(https://goo.gl/A0ynht);
    background-size: cover;
    background-position: center center;
    color: #fff;
    min-height: 650px;
    position: relative;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.6s cubic-bezier(1, -0.375, 0.285, 0.995);
    z-index: 1000;
    border-top-left-radius: 45px !important;
    border-bottom-right-radius: 45px !important;
}
.brand.active {
  width: 100%;
}
.brand::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 150, 64, 1);
    z-index: -1;
    border-top-left-radius: 45px !important;
    border-bottom-right-radius: 45px !important;
}
.brand a.logo {
      color: #f95959;
      font-size: 20px;
      font-weight: 700;
      text-decoration: none;
      line-height: 1em;
}
.brand a.logo span {
  font-size: 30px;
  color: #fff;
  transform: translateX(-5px);
  display: inline-block;
}
.brand .heading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  transition: all 0.6s;
}
.brand .heading.active {
  top: 100px;
  left: 100px;
  transform: translate(0);
}
.brand .heading h2 {
  font-size: 70px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0;
}
.brand .heading p {
  font-size: 15px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 2px;
  /*white-space: 4px;*/
  font-family: "Raleway", sans-serif;
  margin-top:10px; 
}
.brand .success-msg {
  width: 100%;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 60px;
}
.brand .success-msg p {
  font-size: 25px;
  font-weight: 400;
  font-family: "Raleway", sans-serif;
}
.brand .success-msg a {
  font-size: 12px;
  text-transform: uppercase;
  padding: 8px 30px;
  background: #f95959;
  text-decoration: none;
  color: #fff;
  border-radius: 30px;
}
.brand .success-msg p, .brand .success-msg a {
  transition: all 0.9s;
  transform: translateY(20px);
  opacity: 0;
}
.brand .success-msg p.active, .brand .success-msg a.active {
  transform: translateY(0);
  opacity: 1;
}

.form {
  position: relative;
}
.form .form-peice {
    background: #fff;
    min-height: 650px;
    /*margin-top: 30px;*/
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    color: #bbbbbb;
    padding: 30px 0 60px;
    transition: all 0.9s cubic-bezier(1, -0.375, 0.285, 0.995);
    position: absolute;
    top: 0;
    left: -30%;
    width: 130%;
    overflow: hidden;
    border-top-left-radius: 45px !important;
    border-bottom-right-radius: 45px !important;
}
.form .form-peice.switched {
  transform: translateX(-100%);
  width: 100%;
  left: 0;
}
.form form {
  padding: 0 40px;
  margin: 0;
  width: 70%;
  position: absolute;
  top: 50%;
  left: 60%;
  transform: translate(-50%, -50%);
}
.form form .form-group {
  margin-bottom: 5px;
  position: relative;
}
.form form .CTA a.switch {
  font-size: 13px;
  font-weight: 400;
  color: rgb(0, 150, 64);
  text-decoration: underline;
  transition: all 0.3s;
}
.form form .CTA a.switch:hover {
    color: #DF1995;
}
footer {
  text-align: center;
}
footer p {
  color: #777;
}
footer p a, footer p a:focus {
  color: #b8b09f;
  transition: all 0.3s;
  text-decoration: none !important;
}
footer p a:hover, footer p a:focus:hover {
  color: #f95959;
}

@media (max-width: 480px) {
  section#formHolder .form {
    width: 100vw;
    margin-left: 0;
  }
  h2 {
    font-size: 50px !important;
  }
}

/* ==========================
   Alturas fijas SOLO desktop
   ========================== */
@media (min-width: 769px) {
    body {
        display: flex;
        flex-direction: column;
    }

    /* Este es el ajuste importante */
    section#formHolder {
        margin-top: clamp(60px, 5vh, 80px)
    }

    .brand {
        min-height: 600px;
        height: auto !important; /* que crezca */
    }

    .form .form-peice {
        min-height: 600px;
        height: auto !important; /* que crezca */
    }

    section#formHolder {
        min-height: calc(100svh - var(--footerH));
        max-height: none !important; /*  quitar límite */
    }
}


@media (max-width: 768px) {

    section#formHolder .brand img {
        height: 58px !important;
        margin-bottom: 10px;
        margin-top: 25px;
    }


    section#formHolder .brand::before {
        border-top-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    /* 1) AIRE: separa el panel blanco del verde */
    #formHolder .form {
        margin-top: 10px !important; /* separa brand vs form */
    }


    /* 1) Quitar comportamiento desktop (slide/absolute) */
    #formHolder .form .form-peice {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        transform: none !important;
        height: auto !important;
        min-height: auto !important;
        border-radius: 18px !important;
        padding: 18px 16px 22px !important;
        box-sizing: border-box !important;
        /* CLAVE: ocultar por defecto */
        display: none !important;
    }

        /* 2) Mostrar SOLO el panel activo */
        #formHolder .form .form-peice.switched {
            display: block !important;
        }

    /* 3) Si por lo que sea ninguno tiene switched, muestra LOGIN (tu login es .signup) */
    #formHolder .form .signup.form-peice {
        display: block !important;
    }

    /* 4) El <form> al flujo */
    #formHolder .form .form-peice form {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 5) Verde en móvil (para que no empuje) */
    #formHolder .brand {
        min-height: 180px !important;
        height: auto !important;
    }

    section#formHolder {
        max-height: none !important;
    }

    /* Si REGISTRO está activo, NO muestres el fallback de LOGIN */
    #formHolder .form .login.form-peice.switched ~ .signup.form-peice {
        display: none !important;
    }

    /* (Opcional) Si LOGIN está activo, NO muestres REGISTRO */
    #formHolder .form .signup.form-peice.switched ~ .login.form-peice {
        display: none !important;
    }

    #formHolder .form .form-label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 12px 0 8px !important;
        font-size: 15px !important;
        line-height: 1.2;
    }

    /* 3) Más separación entre "filas" */
    #formHolder .form .col-sm-12 {
        margin-bottom: 10px !important;
    }

        /* 4) Las filas d-flex que hoy están apretadas */
        #formHolder .form .col-sm-12.d-flex {
            flex-wrap: wrap !important;
            gap: 10px !important; /* separación entre inputs */
        }

    /* 2 columnas con gap */
    #formHolder .form .w-30 {
        width: 34% !important;
    }

    #formHolder .form .w-75 {
        width: calc(66% - 10px) !important;
    }

    #formHolder .form .w-50 {
        width: calc(50% - 6px) !important;
    }

    /* 6) Inputs/textarea un poquito más altos para lectura */
    #formHolder .form input.form-ctrl,
    #formHolder .form select.form-ctrl,
    #formHolder .form textarea {
        padding: 10px 12px !important;
        font-size: 15px !important;
    }

    /* 7) Checkboxes y links: más aire */
    #formHolder .form .form-check {
        margin-top: 10px !important;
    }

    #formHolder .form .CTA {
        margin-top: 14px !important;
    }

        #formHolder .form .CTA a.switch {
            margin-top: 10px !important;
            display: inline-block;
        }
}