// Note: This file is dependent on Sass and Compass.
// Sass = http://sass-lang.com
// Compass = http://compass-style.org

@import compass/css3/background-clip
@import compass/css3/border-radius
@import compass/css3/box-shadow
@import compass/css3/box-sizing
@import compass/css3/gradient

// `Widths
//----------------------------------------------------------------------------------------------------

.input_tiny
  width: 50px

.input_small
  width: 100px

.input_medium
  width: 150px

.input_large
  width: 200px

.input_xlarge
  width: 250px

.input_xxlarge
  width: 300px

.input_full
  width: 100%

// Added via JS to <textarea> and class="input-full".
// Applies only to IE7. Other browsers don't need it.

.input_full_wrap
  display: block
  padding-right: 8px

// `UI Consistency
//----------------------------------------------------------------------------------------------------

::-moz-focus-inner
  border: 0
  padding: 0

input[type="search"]::-webkit-search-decoration
  display: none

input[type="radio"],
input[type="checkbox"]
  position: relative
  vertical-align: top
  top: 3px
  // IE8, IE9, IE10
  top: 0\0
  // IE7
  *top: -3px

// iPad
@media (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 1024px)
  input[type="radio"],
  input[type="checkbox"]
    vertical-align: baseline
    top: 2px

// iPhone 3
@media (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 480px)
  input[type="radio"],
  input[type="checkbox"]
    vertical-align: baseline
    top: 0

// iPhone 4
@media (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 480px)
  input[type="radio"],
  input[type="checkbox"]
    vertical-align: baseline
    top: 0

input,
button,
select,
textarea
  margin: 0
  vertical-align: middle

button:focus,
input:focus,
select:focus,
textarea:focus,
  +box-shadow(#06f 0 0 7px 0)
  // for Opera
  z-index: 1

input[type="file"],
input[type="radio"],
input[type="checkbox"]
  &:focus,
  &:active
    +box-shadow(none)

button,
input[type="reset"],
input[type="submit"],
input[type="button"]
  -webkit-appearance: none
  +border-radius(4px)
  +background-clip(padding-box)
  background: #ddd image-url('button.png') repeat-x
  +background-image(linear-gradient(#fff, #ddd))
  border: 1px solid
  border-color: #ddd #bbb #999
  cursor: pointer
  color: #333
  // Helvetica Neue present, because it works better
  // for line-height on buttons than Arial, on OS X.
  font: bold 12px/1.3 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif
  outline: 0
  overflow: visible
  padding: 3px 10px
  text-shadow: #fff 0 1px 1px
  width: auto
  &:hover
    +background-image(linear-gradient(#fff, #eee 1px, #ccc))
  &:active
    +background-image(linear-gradient(#fff, #ddd 1px, #eee))
    +box-shadow(inset rgba(#000, 0.25) 0 1px 2px 0)
    border-color: #999 #bbb #ddd
  // IE7
  *padding-top: 2px
  *padding-bottom: 0

button
  // IE7
  *padding-top: 1px
  *padding-bottom: 1px

textarea,
select,
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"]
  +box-sizing(border-box)
  +background-clip(padding-box)
  +border-radius(0)
  -webkit-appearance: none
  background-color: #fff
  border: 1px solid
  border-color: #848484 #c1c1c1 #e1e1e1
  color: #000
  outline: 0
  padding: 2px 3px
  text-align: left
  font-size: 13px
  // Leaving out Helvetica Neue, to not throw off size="..."
  // on inputs. Arial is more reliable, on Windows and OS X.
  font-family: Arial, 'Liberation Sans', FreeSans, sans-serif
  height: 1.8em
  // IE7
  *padding-top: 2px
  *padding-bottom: 1px
  *height: auto
  &[disabled]
    background-color: #eee

button[disabled],
input[disabled],
select[disabled],
select[disabled] option,
select[disabled] optgroup,
textarea[disabled]
  +box-shadow(none)
  -moz-user-select: -moz-none
  -webkit-user-select: none
  -khtml-user-select: none
  user-select: none
  color: #888
  cursor: default

// Separate rule for Firefox.
// Separate rule for IE, too.
// Cannot stack with WebKit's.
::-webkit-input-placeholder
  color: #888

input:-moz-placeholder,
textarea:-moz-placeholder
  color: #888

input.placeholder_text,
textarea.placeholder_text
  color: #888

\:invalid
  // Suppress red glow that Firefox
  // adds to form fields by default,
  // even when user is still typing.
  +box-shadow(none)

textarea,
select[size],
select[multiple]
  height: auto

// Tweaks for Safari + Chrome.
@media (-webkit-min-device-pixel-ratio: 0)
  select[size],
  select[multiple]
    background-image: none
    padding-right: 3px
  select,
  select[size="0"],
  select[size="1"]
    background-image: image-url('select_arrow.gif')
    background-repeat: no-repeat
    background-position: right center
    padding-right: 20px
    height: 1.8em
  ::-webkit-validation-bubble-message
    -webkit-box-shadow: rgba(#000, 0.5) 0 0 5px 0
    box-shadow: rgba(#000, 0.5) 0 0 5px 0
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666), color-stop(1, #000))
    border: 1px solid
    border-color: #747474 #5e5e5e #4f4f4f
    color: #fff
    font: 13px/17px 'Lucida Grande', Arial, 'Liberation Sans', FreeSans, sans-serif
    overflow: hidden
    padding: 15px 15px 17px
    text-shadow: #000 0 0 1px
    height: 16px
  ::-webkit-validation-bubble-arrow,
  ::-webkit-validation-bubble-top-outer-arrow,
  ::-webkit-validation-bubble-top-inner-arrow
    -webkit-box-shadow: none
    box-shadow: none
    background: #666
    border: 0

textarea
  min-height: 40px
  overflow: auto
  resize: vertical
  width: 100%

optgroup
  color: #000
  font-style: normal
  font-weight: normal

// `IE6
//----------------------------------------------------------------------------------------------------

// Everything below this line is for IE6.
// Delete it if you don't support it! :)

// Classes are added dynamically via JS,
// because IE6 doesn't support attribute
// selectors: .ie6_button, .ie6_input, etc.

// Note: These style rules are somewhat
// duplicated because IE6 bombs out when
// it sees attribute selectors. Example:

// .ie6_button {
//   This works in IE6.
// }

// .ie6_button,
// input[type=submit] {
//   This doesn't work.
// }

.ie6_button,
* html button
  background: #ddd image-url('button.png') repeat-x
  border: 1px solid
  border-color: #ddd #bbb #999
  cursor: pointer
  color: #333
  font: bold 12px/1.2 Arial, sans-serif
  padding: 2px 10px 0px
  overflow: visible
  width: auto

* html button
  padding-top: 1px
  padding-bottom: 1px

.ie6_input,
* html textarea,
* html select
  background: #fff
  border: 1px solid
  border-color: #848484 #c1c1c1 #e1e1e1
  color: #000
  padding: 2px 3px 1px
  font-size: 13px
  font-family: Arial, sans-serif
  vertical-align: top

* html select
  margin-top: 1px

.placeholder_text,
.ie6_input_disabled,
.ie6_button_disabled
  color: #888

.ie6_input_disabled
  background: #eee