@import "_mixins.scss";
@import "_variables.scss";

/*========================================================
                      Contact Form
=========================================================*/
$input-font-family: $default-font;
$input-font: 400 16px $input-font-family;
$input-font-weight: 400;
$input-font-size: 16px;

$input-height: 50px;
$input-line-height: 26px;

$input-color: #999999;
$input-bg: #fff;
$input-border: 2px solid darken(saturate(adjust_hue(#f4f4f4, 0), 6.382978723404229%), 4.901960784313729%);
$input-border-radius: 3px;

$texarea-height: 137px;
$label-margin: 0 0 8px;
$texarea-margin: 0 0 25px;

$input-padding-vertical: (($input-height - $input-line-height) / 2);
$input-padding-horizontal: 20px;

$error-color:              #d9534f;
$success-color:            #5cb85c;

/* Contact Form Basic Styles
========================================================*/
#contact-form {
  position: relative;
}

#contact-form label {
  @include box-sizing(border-box);
  position: relative;
  display: block;
  letter-spacing: normal;
  margin: $label-margin;
  width: 100%;

}

#contact-form label.message {
  max-width: 100%;
  width: 100%;
  margin: $texarea-margin;
}

#contact-form fieldset {
  border: none;
}

@mixin input-styles() {
  font: $input-font;
  color: $input-color;
}

@mixin input-styles2() {
  background-color: $input-bg;
  border: $input-border;
  width: 100%;
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
}

/* Contact Form Placeholder Styles
========================================================*/

#contact-form ._placeholder {
  @include box-sizing(border-box);
  @include input-styles();
  width: 100% !important;
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  border-radius: 0;
  cursor: text;
}

#contact-form ._placeholder.focused {
  @include opacity(0.4);
}

#contact-form ._placeholder.hidden,
#contact-form .file ._placeholder {
  display: none;
}

/* Contact Form Input
========================================================*/
#contact-form input[type='text'] {
  @include box-sizing(border-box);
  @include input-styles();
  @include input-styles2();
  @include border-radius(3px);
  height: $input-height;
  margin: 0;
}

/* Contact Form Buttons
========================================================*/
#contact-form .btn-wr {
  margin-top: 34px;
  a {
    width: 169px;
    padding: 11px 17px;
    @include box-sizing(border-box);
    display: inline-block;
  }

  @media (max-width: 767px) {
    a {
      width: 100%;
    }
  }
}

/* Contact Form Textarea 
========================================================*/
#contact-form textarea {
  display: block;
  @include box-sizing(border-box);
  @include input-styles();
  @include input-styles2();
  @include border-radius(3px);
  resize: none;
  height: $texarea-height;
  overflow: auto;
}

/* Contact Form Error messages
========================================================*/
#contact-form .empty-message,
#contact-form .error-message {
  @include transition(0.3s ease-in height);
  position: absolute;
  right: 3px;
  top: 2px;
  color: red;
  height: 0;
  overflow: hidden;
  font-size: 11px;
  z-index: 99;
}

#contact-form .invalid .error-message,
#contact-form .empty .empty-message {
  height: 14px;
  line-height: 14px;
}

/* Contact Form Processing Box
========================================================*/
#contact-form .contact-form-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  @include opacity(0);
  z-index: -1;
  overflow: hidden;
  background: rgba(247, 247, 247, 0.48) url(data:image/gif;base64,R0lGODlhIAAKAIAAAP///////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCQAAACwAAAAAIAAKAAACD4yPqcvtD6OctNqLs94cFwAh+QQJCQAFACwAAAAAIAAKAILs7uz8+vz09vT08vT8/vz///8AAAAAAAADMVgx3FIwykmhADjjVzsdmjZ4ZASG2FiSJ6quXRu+8IemdXwDdB5dt54PsgA1BoThJAEAIfkECQkACAAsAAAAACAACgCDtLK03Nrc1NLUvL68/Pr81NbUxMLE/P78////AAAAAAAAAAAAAAAAAAAAAAAAAAAABDjwBGMGNeWgzbv/SACM5CiAKGiU5ZC+3MqOLvwOM22/8lzvqhzgB/TgcsQipyA0KD8HAe5o0Tw7EQAh+QQJCQAMACwAAAAAIAAKAIN0dnS8vrysrqyMioy0trSUkpT8+vy0srSMjoy8uryUlpT8/vz///8AAAAAAAAAAAAEPnAFVWpRZLHNu/9MAIzkeIAoqJQlkr5cwZIDDK8zUNupPA4/HS+Fm+2GnyLriOwkaKVT07M4FAbYQeFgmHoiACH5BAkJAAsALAAAAAAgAAoAg7SytNza3Ozu7NTS1Pz6/Ly+vPT29PTy9NTW1Pz+/MTCxP///wAAAAAAAAAAAAAAAARUMAWlClUorUWO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AAAAAIAAKAIO0srTc2tzU0tS8vrz8+vzU1tTEwsT8/vz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAEOBDJSatFJxgztinHJV4BYJ6mMK6TgaIDy7qvGcvjUNv4SNe3nuVXE150u6BxUtgBDMvKQaBDdg4RACH5BAkJAAUALAAAAAAgAAoAguzu7Pz6/PT29PTy9Pz+/P///wAAAAAAAAMvWLrcrmHIKZ61Auitw/3LwHEDCIqjVpoXmq7s445w3MykLaeb7mS8mg8iAYgkhAQAOw==);
  background-repeat: no-repeat;
  background-position: 50% 50%;
}

#contact-form.processing .contact-form-loader {
  @include transition(all 0.3s ease-in);
  @include opacity(0.7);
  z-index: 99;
}

/* Contact Form Modal
========================================================*/
.modal-open {
  overflow: hidden;
}

#contact-form .modal {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  letter-spacing: normal;
  display: none;
  overflow: auto;
  overflow-y: scroll;
  position: fixed;
  z-index: 1050;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  font-family: $input-font-family;
  font-size: 13px;
  color: #222;
}

#contact-form .modal h4 {
  font-weight: bold;
  color: #000;
  padding: 0;
  margin: 0;
}

.modal.fade .modal-dialog {
  @include transition(transform 0.3s ease-out);
  @include transform(translate(0, -25%));
}

.modal.in .modal-dialog {
  @include transform(translate(0, 0));
}

.modal-content {
  position: relative;
  background-color: #ffffff;
  border: 1px solid #999999;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
  background-clip: padding-box;
  outline: none;
}

.modal-backdrop {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: fixed;
  z-index: 1040;
  background-color: #000000;
}

.modal-backdrop.fade {
  @include opacity(0);
}

.modal-backdrop.in {
  @include opacity(0.5);
}

.modal-header {
  padding: 15px;
  border-bottom: 1px solid #e5e5e5;
  min-height: 16.42857143px;
}

.modal-header .close {
  margin-top: -2px;
}

.modal-title {
  margin: 0;
  line-height: 1.42857143;
}

.modal-body {
  position: relative;
  padding: 20px;
}

.modal-dialog {
  width: 600px;
  margin: 10px auto;
}

@media only screen and (max-width: 768px) {
  .modal-dialog {
    position: relative;
    width: auto;
    margin: 10px;
  }
}

/* Contact Form Close icon
========================================================*/
.close {
  float: right;
  font-size: 21px;
  font-weight: bold;
  line-height: 1;
  color: #000000;
  text-shadow: 0 1px 0 #ffffff;
  opacity: 0.2;
  filter: alpha(opacity=20);
}

.close:hover,
.close:focus {
  color: #000000;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.5;
  filter: alpha(opacity=50);
}

button.close {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-appearance: none;
}

/* Contact Form reCaptcha
========================================================*/

#contact-form label.recaptcha{
    max-width: 100%;
    text-align: right;
}

#captchadiv{
    display: inline-block;
    text-align: left;
    background: #FFF;

    .empty-message + &{
        border: 1px solid #DCDCDC;
        padding-top: 16px;
    }
}

#recaptcha_table{
    border: none!important;

    input[type="text"]{
        background: #FFF;
        border: 1px solid #CDCDCD!important;
        color: #999;
    }
}

@media (max-width: 767px) {
    #captchadiv{
        display: block;
    }

    #recaptcha_table{
        width: 100%;

        tr:first-child td + td{
            padding-right: 14px!important;
        }

        tr:first-child td + td + td{
            display: none;
        }
    }

    #recaptcha_image{
        width: 358px!important;
    }

    #recaptcha_response_field{
        width: 360px!important;
    }
}

@media (max-width: 479px) {
    #recaptcha_image{
        width: 208px!important;
    }

    #recaptcha_response_field{
        width: 210px!important;
    }
}


html body {
  .rd-mailform {
    position: relative;
    text-align: left;
  }

  .form-input {
    display: block;
    width: 100%;
    height: $input-height;
    padding: $input-padding-vertical $input-padding-horizontal;
    font-size: $input-font-size;
    font-weight: $input-font-weight;
    line-height: $input-line-height;
    color: $input-color;
    background-color: $input-bg;
    background-image: none;
    border: $input-border;
    border-radius: $input-border-radius;
    -webkit-appearance: none;
    transition: .3s ease-in-out;
    box-sizing: border-box;

    &:focus { outline: 0; }
  }

  textarea.form-input {
    height: 191px;
    min-height: $input-height;
    max-height: 191px * 2;
    resize: vertical;
  }

  .form-wrap {
    position: relative;
  }

  .form-label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
    margin: 0;
    padding: $input-padding-vertical $input-padding-horizontal;
    font-size: $input-font-size;
    font-weight: $input-font-weight;
    line-height: $input-line-height;
    pointer-events: none;
    transition: .3s;
    color: $input-color;

    &.focus { opacity: 0; }
    &.auto-fill { color: $input-color; }
  }

  .form-validation {
    position: absolute;
    left: $input-padding-horizontal;
    right: $input-padding-horizontal;
    bottom: 2px;
    font-size: 11px;
    line-height: 11px;
    color: red;
    transition: .3s;
    z-index: 11;
  }

  .form-wrap + .form-wrap {
    margin-top: 10px;
  }

  #form-output-global {
    position: fixed;
    bottom: 30px;
    left: 15px;
    transform: translateX(-500px);
    z-index: 9999999;
    font-size: 14px;
    transition: .3s all ease;
    visibility: hidden;

    &.active {
      transform: translateX(0);
      visibility: visible;
    }

    @media (min-width: 480px) {
      left: 30px;
    }
  }

  .form-output {
    position: absolute;
    top: 100%;
    left: 0;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 2px;
    transition: .3s;
    opacity: 0;
    visibility: hidden;

    &.active {
      opacity: 1;
      visibility: visible;
    }

    &.error {
      color: $error-color;
    }

    &.success {
      color: $success-color;
    }
  }
}