/* ----------------------------------
* Input areas
* ---------------------------------- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea {
  -moz-box-sizing: border-box;
  display: block;
  overflow: hidden;
  width: 100%;
  height: 4rem;
  resize: none;
  padding: 0 1rem;
  font-size: 2rem;
  line-height: 4rem;
  border: 0.1rem solid #bdc3c7;
  box-shadow: none; /* override the box-shadow from the system (performance issue) */
  background: #fff;
}

textarea {
  height: 10rem;
  max-height: 10rem;
  line-height: 2rem;
  margin: 0;
}

/* fix for required inputs with wrong or empty value e.g. [type=email] */
input:invalid,
textarea:invalid {
  border: 0.1rem solid #820000;
  color: #b90000;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: #01bfd6;
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: #bdc3c7;
  opacity: 1;
}

form p {
  position: relative;
  margin: 0;
}

form p + p {
  margin-top: 1rem;
}

form p input:focus {
  padding: 0 3rem 0 1rem;
}

form p input + button[type="reset"],
form p textarea + button[type="reset"] {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 1.6rem;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  font-size: 0;
  opacity: 0;
  margin: -0.8rem 0 0 0;
  pointer-events: none;
  border-radius: 1.5rem;
  background: #939393;
}

form p input + button[type="reset"]:before,
form p textarea + button[type="reset"]:before {
  top: -0.2rem;
  left: -0.7rem;
  position: absolute;
  content: "f";
  width: 2rem;
  font-size: 3rem;
  height: 2rem;
  line-height: 2rem;
  color: #fff;
  font-family: "whatev";
  -moz-osx-font-smoothing: grayscale;
}


/* To avoid colission with BB butons */
li input + button[type="reset"]:after,
li textarea + button[type="reset"]:after {
  background: none;
}

textarea {
  padding: 1.2rem;
}

form p input:focus + button[type="reset"],
form p textarea:focus + button[type="reset"] {
  opacity: 1;
  pointer-events: all;
}

/* Fieldset */
fieldset {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0.1rem solid rgba(0,0,0,.2);
  font-size: 1.8rem;
  line-height: 1em;
  background: #fff;
}

fieldset  + fieldset {
  margin-top: 1.5rem;
}

fieldset legend {
  -moz-box-sizing: border-box;
  position: absolute;
  width: 9.5rem;
  height: 100%;
  padding: 0 0.5rem 0 1.5rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #333;
  line-height: 4rem;
  text-transform: uppercase;
}

fieldset legend:active {
  background-color: #008caa;
  text-shadow: 0.1rem 0.1rem 0 rgba(255,255,255,.3);
}

fieldset section input[type="text"],
fieldset section input[type="password"],
fieldset section input[type="email"],
fieldset section input[type="tel"],
fieldset section input[type="search"],
fieldset section input[type="number"],
fieldset section textarea {
  height: 4rem;
  border: none;
  border-radius: 0;
  background: none;
}

fieldset section {
  display: block;
  border-left: 0.1rem solid #ddd;
  border-radius: 0 0.3rem 0.3rem 0;
  overflow: hidden;
  margin-left: 9.5rem;
}

fieldset section p {
  margin: 0;
  border-bottom: 0.1rem solid #ddd;
}

fieldset section p:last-child {
  border-bottom: none;
}

/* Tidy (search/submit) */
form[role="search"] {
  position: relative;
  height: 3.5rem;
  line-height: 3.5rem;
  background: #eceae9;
  border-bottom: 0.1rem solid #dfdfdf;
  padding: 0;
}

form[role="search"]:before {
  content: "8";
  font-family: "whatev";
  font-size: 2.5rem;
  position: absolute;
  top: 0;
  left: 1.8rem;
  height: 2rem;
  width: 2rem;
  color: #c2c1c1;
}

form[role="search"] p {
  margin: 0 1rem 0 4.5rem;
  overflow: hidden;
}

form[role="search"] p input,
form[role="search"] p textarea {
  height: 3.5rem;
  line-height: 3.5rem;
  border: none;
  background: none;
  font-size: 1.6rem;
  padding: 0;
}

form[role="search"] p input:focus {
  padding: 0 2rem 0 0;
}

form[role="search"] p input:invalid, 
form[role="search"] p textarea:invalid {
  border: none;
}

form[role="search"] button.icon:before {
  content: "";
  position: absolute;
  width: 3rem;
  height: 3.7rem;
  background: transparent center no-repeat;
  top: 0;
  left: 0;
}

form[role="search"] p button[type="reset"] {
  right: 0;
}

form[role="search"] button[type="submit"] {
  float: right;
}

form[role="search"] button[type="submit"] + p > textarea {
  height: 3rem;
  line-height: 2rem;
  font-size: 1.8rem;
}

form[role="search"].full button[type="submit"] {
  display: none;
}

/******************************************************************************
 * Right-to-Left layout
 */

/*html[dir="rtl"] form p input:valid,
html[dir="rtl"] form p input:valid:focus {
  padding: 0 1.2rem 0 3rem;
}

html[dir="rtl"] form p input + button[type="reset"],
html[dir="rtl"] form p textarea + button[type="reset"] {
  right: auto;
  left: 0;
}

html[dir="rtl"] fieldset legend.action:after {
  margin: 0 0.5rem 0 0;
}

html[dir="rtl"] fieldset legend {
  padding: 0 1.5rem 0 0.5rem;
}

html[dir="rtl"] form[role="search"] p input {
  padding: 0;
}

html[dir="rtl"] form[role="search"] p input:focus {
  padding: 0 0 0 2rem;
}

html[dir="rtl"] form[role="search"] button[type="submit"] + p > button {
  left: 0;
}*/
