/* -*- coding: utf-8 -*-
 * Copyright (C) 2011 Grégoire Détrez, Patrik Willard
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
/* ~*~ Form styling ~*~
 *
 * A lot of this is inspired by the nice google signup form.
 */
/* ~*~ Global form layout ~*~ */
form {
  background: #F1F1F1;
  border-radius: 1px;
  -moz-border-radius: 1px;
  -webkit-border-radius: 1px;
  max-width: 30em;
  margin-top: -2px;
  /* Compensate for the borer width */
  margin-left: auto;
  margin-right: auto;
  padding: 20px; }

/* ~*~ Special case for PayPal forms that are only a single button ~*~ */
.paypal form {
  background: inherit;
  border: none;
  margin: 0;
  padding: 0; }

/* ~*~ Form elements ~*~ */
input[type=text], input[type=mail] {
  border: 1px solid #D9D9D9;
  border-radius: 1px;
  -moz-border-radius: 1px;
  -webkit-border-radius: 1px;
  box-sizing: border-box;
  color: black;
  display: inline-block;
  margin: 8px 0 0;
  padding: 0px 8px;
  width: 90%;
  height: 32px; }
  input[type=text]:focus, input[type=mail]:focus {
    outline: none;
    border: 1px solid #4d90fe;
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }

textarea {
  border: 1px solid #D9D9D9;
  border-radius: 1px;
  -moz-border-radius: 1px;
  -webkit-border-radius: 1px;
  box-sizing: border-box;
  color: black;
  display: inline-block;
  margin: 8px 0 0;
  padding: 0px 8px;
  width: 90%;
  height: 72px;
  padding-top: 8px;
  padding-bottom: 8px; }
  textarea:focus {
    outline: none;
    border: 1px solid #4d90fe;
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }

ul.choices.radio {
  padding: 0 0 0 1em; }

ul.choices.radio label {
  font-weight: normal;
  margin: 0 0 0 2em; }

ul.choices.radio label.disabled {
  text-decoration: line-through; }

ul.choices.radio input[type=radio] {
  float: left;
  width: 2em; }

.inline-choices label {
  display: inline-block;
  margin-right: .5em; }

div.submit-button {
  text-align: right;
  margin-top: 20px; }

button, a.button {
  color: white;
  display: inline-block;
  /* Vertical rythm:
   * 
   * to get aproximately
   *   height: 32px;
   * But setting line-height and padding.
   */
  line-height: 20px;
  padding: 6px 8px 6px 8px;
  margin: 3px 19px 3px 0;
  min-width: 46px;
  text-align: center;
  text-decoration: none;
  text-indent: 0px;
  text-shadow: rgba(0, 0, 0, 0.297) 0px 1px 0px;
  text-transform: none;
  vertical-align: bottom;
  white-space: pre;
  border: 1px solid transparent;
  color: #fff;
  text-shadow: 0 1px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  background-color: #d14836;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#dd4b39), to(#d14836));
  background-image: -webkit-linear-gradient(top, #dd4b39, #d14836);
  background-image: -moz-linear-gradient(top, #dd4b39, #d14836);
  background-image: -ms-linear-gradient(top, #dd4b39, #d14836);
  background-image: -o-linear-gradient(top, #dd4b39, #d14836);
  background-image: linear-gradient(top, #dd4b39, #d14836); }

button:hover, a.button:hover {
  border: 1px solid #b0281a;
  text-shadow: 0 1px rgba(0, 0, 0, 0.3);
  background-color: #c53727;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#dd4b39), to(#c53727));
  background-image: -webkit-linear-gradient(top, #dd4b39, #c53727);
  background-image: -moz-linear-gradient(top, #dd4b39, #c53727);
  background-image: -ms-linear-gradient(top, #dd4b39, #c53727);
  background-image: -o-linear-gradient(top, #dd4b39, #c53727);
  background-image: linear-gradient(top, #dd4b39, #c53727);
  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  -o-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); }

button:active, a.button:active {
  background-color: #b0281a;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#dd4b39), to(#b0281a));
  background-image: -webkit-linear-gradient(top, #dd4b39, #b0281a);
  background-image: -moz-linear-gradient(top, #dd4b39, #b0281a);
  background-image: -ms-linear-gradient(top, #dd4b39, #b0281a);
  background-image: -o-linear-gradient(top, #dd4b39, #b0281a);
  background-image: linear-gradient(top, #dd4b39, #b0281a);
  border: 1px solid #992a1b;
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }

button.disabled, a.button.disabled {
  background-color: #666666;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#555555), to(#666666));
  background-image: -webkit-linear-gradient(top, #555555, #666666);
  background-image: -moz-linear-gradient(top, #555555, #666666);
  background-image: -ms-linear-gradient(top, #555555, #666666);
  background-image: -o-linear-gradient(top, #555555, #666666);
  background-image: linear-gradient(top, #555555, #666666); }

form ul {
  list-style-type: none; }

input[type="checkbox"] {
  -webkit-appearance: none;
  -webkit-box-shadow: none;
  -webkit-rtl-ordering: logical;
  -webkit-user-select: text;
  background-attachment: scroll;
  background-clip: border-box;
  background-color: white;
  background-image: none;
  background-origin: padding-box;
  border-bottom-color: #C6C6C6;
  border-bottom-left-radius: 1px;
  border-bottom-right-radius: 1px;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  border-left-color: #C6C6C6;
  border-left-style: solid;
  border-left-width: 1px;
  border-right-color: #C6C6C6;
  border-right-style: solid;
  border-right-width: 1px;
  border-top-color: #C6C6C6;
  border-top-left-radius: 1px;
  border-top-right-radius: 1px;
  border-top-style: solid;
  border-top-width: 1px;
  box-shadow: rgba(0, 0, 0, 0.098) 0px 1px 1px 0px inset;
  box-sizing: border-box;
  color: black;
  cursor: pointer;
  direction: ltr;
  display: block;
  float: left;
  height: 13px;
  letter-spacing: normal;
  line-height: normal;
  margin-bottom: 0px;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 2px;
  padding: 0;
  position: relative;
  text-align: -webkit-auto;
  text-indent: 0px;
  text-shadow: none;
  text-transform: none;
  vertical-align: bottom;
  width: 13px;
  word-spacing: 0px; }

input[type=checkbox]:checked {
  background: #fff; }

input[type=checkbox]:checked::after {
  content: url(https://ssl.gstatic.com/ui/v1/menu/checkmark.png);
  content: "✔";
  display: block; }

form div.errors input, form div.errors textarea {
  border-color: #dd0000; }

form p.error {
  color: #dd0000; }

form label {
  display: block;
  font-size: 16px;
  font-weight: bold;
  margin-top: 20px; }

form h3 {
  margin-top: 20px; }

form h3:first-child {
  margin-top: 0px; }

form label span {
  display: block;
  margin-left: 28px;
  font-weight: normal; }

form p.help_text {
  color: #666;
  font-style: italic;
  margin-bottom: 0; }

form ul.errorlist {
  margin: 0;
  color: red; }
