@import url("https://fonts.googleapis.com/css?family=Roboto+Slab:400,700&display=swap");
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap");

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  background-color: #f2f4f8;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background: #fff;
  max-width: 640px;
  width: 100%;
  border-radius: 12px;
  padding: 0 20px 30px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12),
              0 4px 6px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* --- VOLVER --- */
.volver-button {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #0077b6;
  background-color: #e3f2fd;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  margin: 15px 0 10px;
  position: relative;
  z-index: 2;
}
.volver-button:hover {
  background-color: #bbdefb;
}

/* --- HEADER IMAGE --- */
.header-full {
  width: 100%;
  display: block;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* --- TÍTULO + LOGO --- */
.header {
  text-align: center;
  margin-top: 20px;
}
.logo-image {
  max-width: 100px;
  margin-bottom: 10px;
}

/* --- FORMULARIO --- */
.formulario {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
}
.input-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 320px;
}
.input-group label {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 17px;
}
.input-group input {
  width: 100%;
  padding: 12px;
  font-size: 17px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(15, 172, 238, 0.1);
}
.input-group input:focus {
  border-color: #0facee;
  box-shadow: 0 0 0 3px rgba(15, 172, 238, 0.25);
}
.unidad {
  font-size: 13px;
  margin-top: 4px;
  text-align: center;
  color: #666;
  height: 14px;
}

/* --- RESULTADO --- */
.resultado-box {
  font-size: 18px;
  padding: 15px;
  background: linear-gradient(to right, #e0f7fa, #ffffff);
  border: 1px solid #0facee;
  border-radius: 8px;
  color: #0077b6;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: center;
  margin: 25px auto 0 auto;
  width: 100%;
  max-width: 340px; /* más angosto */
}

/* Estilo para input válido */
.valido {
  border: 2px solid #0077b6 !important;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.3);
}

/* Estilo para input fuera de rango */
.invalido {
  border: 2px solid #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.3);
}

/* Estilo para input en foco (si además es válido) */
.en-foco.valido {
  border-color: #00ced1 !important;
  box-shadow: 0 0 0 3px rgba(0, 206, 209, 0.4);
}


/* --- BOTÓN LIMPIAR --- */
.limpiar-box {
  margin-top: 25px;
  display: flex;
  justify-content: center;
}
button {
  background-color: #0facee;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Roboto Slab', serif;
  font-size: 16px;
  transition: background-color 0.3s ease;
}
button:hover {
  background-color: #1976d2;
}
.limpiar-btn {
  background-color: #0077b6;
}
.limpiar-btn:hover {
  background-color: #005a8a;
}

/* --- RESPONSIVE --- */
@media screen and (max-width: 600px) {
  .container {
    padding: 0 10px 20px;
    border-radius: 0;
    box-shadow: none;
  }

  .header-title {
    font-size: 18px;
  }

  .resultado-box {
    font-size: 16px;
    max-width: 100%;
  }

  .logo-image {
    max-width: 80px;
  }

  .input-group,
  .formulario {
    max-width: 100%;
  }

  .limpiar-box {
    justify-content: center;
  }
}
