:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bg-soft: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --white: #ffffff;
}

* {
  margin: 0; padding: 0; box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-soft);
  overflow: hidden;
  position: relative;
}

/* Fondo Mesh Gradient (Startup Style) */
.background-mesh {
  position: absolute;
  width: 100%; height: 100%;
  z-index: -1;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(96, 165, 250, 0.1) 0px, transparent 50%);
}

.container {
    width: 400px;
    min-height: 620px; /* Cambiamos height por min-height */
    perspective: 1500px;
}

.card {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.active .card { transform: rotateY(180deg); }

.form {
    position: absolute;
    width: 100%;
    height: auto; /* IMPORTANTE: Que no tenga altura fija del 100% */
    min-height: 100%; 
    backface-visibility: hidden;
    background: #ffffff;
    border-radius: 28px;
    padding: 40px 40px 30px 40px; /* Reducimos padding inferior */
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}
.signup { transform: rotateY(180deg); }

/* Encabezado del Formulario */
.form-header { text-align: center; margin-bottom: 32px; }
.logo-icon {
  font-size: 40px; color: var(--primary); margin-bottom: 12px;
}
.form-header h2 { font-size: 24px; color: var(--text-main); font-weight: 700; }
.form-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* Inputs Estilo Startup */
.input-group { margin-bottom: 18px; text-align: left; }
.input-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-main); margin-bottom: 6px;
}
.input-wrapper {
  position: relative; display: flex; align-items: center;
}
.input-wrapper i {
  position: absolute; left: 14px; color: var(--text-muted); font-size: 18px;
}
.form input {
  width: 100%; padding: 12px 14px 12px 42px;
  border: 1px solid var(--border-color);
  border-radius: 12px; font-size: 15px;
  transition: all 0.2s ease;
  background: #fcfcfd;
}
.form input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background: var(--white);
}

/* Botón Principal */
.btn-submit {
  width: 100%; padding: 14px; margin-top: 10px;
  background: var(--primary); color: white;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

/* Regresar Home */
.btn-regresar-home {
  position: absolute; top: 25px; left: 25px;
  text-decoration: none; color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.btn-regresar-home:hover { color: var(--primary); }

/* Checkbox personalizado */
.options {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 20px;
}
.forgot-link { color: var(--primary); text-decoration: none; font-weight: 600; }
/* Estilos para los textos de abajo (Toggle) */
.toggle, .toggleRegister {
    margin-top: auto; /* Empuja el link al fondo de forma orgánica */
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.toggle span, .toggleRegister span {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    margin-left: 5px;
}

/* Alineación de opciones (Recordarme y Olvidaste contraseña) */
.options {
   display: flex;
    justify-content: center; /* Lo centra horizontalmente */
    margin: 10px 0 25px;    /* Espaciado para que no pegue con los botones */
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}


/* Alineación perfecta para el Recordarme */
.check-group {
    display: flex;
    align-items: center; /* Centrado vertical perfecto */
    gap: 8px;            /* Espacio exacto entre el cuadro y el texto */
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;   /* Evita que se seleccione el texto al hacer clic rápido */
}

.check-group input[type="checkbox"] {
    width: 16px;         /* Tamaño estandarizado */
    height: 16px;
    accent-color: var(--primary); /* El checkbox ahora será azul como tu marca */
    cursor: pointer;
    margin: 0;           /* Quitamos márgenes residuales del navegador */
}

.check-group span {
    line-height: 1;      /* Evita que el texto empuje la caja hacia abajo */
}


