/* Dispatch icon font */
@font-face {
  font-family: "dispatch";
  src: url("/fonts/dispatch/dispatch.eot");
  src: url("/fonts/dispatch/dispatch.eot?#iefix") format("embedded-opentype"),
       url("/fonts/dispatch/dispatch.woff") format("woff"),
       url("/fonts/dispatch/dispatch.ttf") format("truetype"),
       url("/fonts/dispatch/dispatch.svg#dispatch") format("svg");
  font-weight: normal;
  font-style: normal;
}

/* Gotham */
@font-face {
  font-family: "gotham";
  src: url("/fonts/gotham/gotham-light-webfont.eot");
  src: url("/fonts/gotham/gotham-light-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gotham-light-webfont.woff") format("woff"),
       url("/fonts/gotham/gotham-light-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gotham-light-webfont.svg#gothamlight") format("svg");
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: "gotham";
  src: url("/fonts/gotham/gotham-book-webfont.eot");
  src: url("/fonts/gotham/gotham-book-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gotham-book-webfont.woff") format("woff"),
       url("/fonts/gotham/gotham-book-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gotham-book-webfont.svg#gothambook") format("svg");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "gotham";
  src: url("/fonts/gotham/gotham-medium-webfont.eot");
  src: url("/fonts/gotham/gotham-medium-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gotham-medium-webfont.woff") format("woff"),
       url("/fonts/gotham/gotham-medium-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gotham-medium-webfont.svg#gothammedium") format("svg");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "gotham";
  src: url("/fonts/gotham/gotham-bold-webfont.eot");
  src: url("/fonts/gotham/gotham-bold-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gotham-bold-webfont.woff") format("woff"),
       url("/fonts/gotham/gotham-bold-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gotham-bold-webfont.svg#gothambold") format("svg");
  font-weight: bold;
  font-style: normal;
}

/* Gotham Rounded */
@font-face {
  font-family: "gotham_rounded";
  src: url("/fonts/gotham/gothamrnd-light-webfont.eot");
  src: url("/fonts/gotham/gothamrnd-light-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gothamrnd-light-webfont.woff") format("woff"),
       url("/fonts/gotham/gothamrnd-light-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gothamrnd-light-webfont.svg#gotham_roundedlight") format("svg");
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: "gotham_rounded";
  src: url("/fonts/gotham/gothamrnd-book-webfont.eot");
  src: url("/fonts/gotham/gothamrnd-book-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gothamrnd-book-webfont.woff") format("woff"),
       url("/fonts/gotham/gothamrnd-book-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gothamrnd-book-webfont.svg#gotham_roundedbook") format("svg");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "gotham_rounded";
  src: url("/fonts/gotham/gothamrnd-medium-webfont.eot");
  src: url("/fonts/gotham/gothamrnd-medium-webfont.eot?#iefix") format("embedded-opentype"),
       url("/fonts/gotham/gothamrnd-medium-webfont.woff") format("woff"),
       url("/fonts/gotham/gothamrnd-medium-webfont.ttf") format("truetype"),
       url("/fonts/gotham/gothamrnd-medium-webfont.svg#gotham_roundedmedium") format("svg");
  font-weight: 600;
  font-style: normal;
}

/* Variables */
:root {
  --color-blue: #1895cc;
  --color-blue-light: #23a0d3;
  --color-blue-lighter: #5bb8e2;
  --color-red-error: #ff3b30;
  --color-white: #ffffff;
  --color-grey-88: #e1e1e1;
  --color-grey-80: #cccccc;
  --color-grey-60: #969799;
  --color-grey-37: #54575e;
  --color-grey-23: #34363a;
  --color-grey-94: #f0f0f0;
  --color-grey-97: #f7f7f7;
  --radius: 3px;
  --input-height: 4.5em;
  --btn-width: 35%;
}

/* Reset */
html {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: gotham, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;
  line-height: 1.2;
  color: var(--color-grey-23);
  background: var(--color-white);
}

/* Dispatch icon glyphs */
.dico-logo-dispatch::before {
  display: inline-block;
  font-family: "dispatch";
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  line-height: 1;
  text-decoration: inherit;
  text-rendering: optimizeLegibility;
  text-transform: none;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  content: "\f119";
}

.dico-smartphone::before {
  display: inline-block;
  font-family: "dispatch";
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  line-height: 1;
  text-decoration: inherit;
  text-rendering: optimizeLegibility;
  text-transform: none;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  content: "\f12a";
}

/* Header */
.header {
  position: relative;
  height: 6em;
  width: 100%;
  background-color: var(--color-white);
}

.partner-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  max-height: 3em;
  min-width: 2em;
  transform: translate(-50%, -50%);
}

/* Masthead */
.masthead {
  width: 100%;
  padding: 0 2em;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(to right, rgba(5, 182, 231, 0.95) 0%, rgba(76, 206, 135, 0.96) 99%);
}

.main {
  position: relative;
  width: 100%;
  max-width: 36em;
  margin: 0 auto;
  padding: 3em 0;
  color: var(--color-white);
}

.heading {
  margin: 0 auto;
  line-height: 1.5em;
  font-weight: 400;
}

.marketing {
  display: block;
  margin: 1.5em auto 0;
  font-size: 1.425em;
  line-height: 1.65em;
  font-weight: 200;
  color: var(--color-white);
}

.marketing--error {
  margin: 0.5em auto 0;
}

.customer-name {
  font-weight: 400;
  color: var(--color-white);
}

/* Phone input container */
.input-container {
  position: relative;
  width: 90%;
  height: var(--input-height);
  margin: 1.5em auto 0;
  border-radius: var(--radius);
  /* Must be visible: .btn-message uses top:100% then translateY(-100%); overflow:hidden clips it entirely. */
  overflow: visible;
  z-index: 0;
}

.input,
.btn-submit {
  display: inline-block;
  vertical-align: top;
  border: none;
  outline: none;
  height: 100%;
}

.input {
  position: relative;
  top: 0;
  left: 0;
  z-index: 100;
  width: 65%;
  text-align: left;
  font-size: 1.5em;
  color: var(--color-grey-37);
  background-color: var(--color-white);
  border-radius: var(--radius) 0 0 var(--radius);
}

#phone-input {
  width: 100%;
  height: 100%;
  padding: 0 0.6rem;
  border: none;
  outline: none;
  color: var(--color-grey-37);
  font-size: 1em;
  font-family: inherit;
}

#phone-input::placeholder {
  color: var(--color-grey-60);
}

/* intl-tel-input overrides to match original style */
.iti {
  width: 100%;
  height: 100%;
}

.iti__selected-country-primary {
  padding-left: 0.5rem !important;
}

.iti__country-container {
  border-right: 1px solid var(--color-grey-80);
}

/* Button */
.btn {
  cursor: pointer;
}

.btn-submit {
  position: relative;
  z-index: 300;
  width: var(--btn-width);
  padding: 0;
  background-color: transparent;
  line-height: var(--input-height);
  text-align: center;
  color: white;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background-color 200ms ease-out;
}

.btn-label {
  position: relative;
  z-index: 300;
  width: 100%;
  height: 100%;
  font-size: 1.2em;
  opacity: 0;
  transform: scale(0);
  transition: opacity 100ms ease-in-out, transform 100ms ease-out;
  pointer-events: none;
  cursor: pointer;
}

.btn-label.ready {
  opacity: 1;
  transform: scale(1);
}

/* Button background */
.btn-background {
  position: absolute;
  z-index: 200;
  top: 0;
  right: 0;
  width: var(--btn-width);
  height: 100%;
  transform-origin: 100% 50%;
  transform: scaleX(1) translate3d(0,0,0);
  transition: transform 500ms ease-out, background-color 200ms ease-out;
}

.btn-backgroundItem {
  position: absolute;
  height: 100%;
  width: 100%;
}

.btn--primary {
  background-color: var(--color-blue);
}

.btn--primary:hover,
.btn--primary.hover {
  background-color: var(--color-blue-light);
}

.btn--error {
  opacity: 0;
  background-color: var(--color-red-error);
}

.btn-background.animated {
  transform: scaleX(2.86) translate3d(0,0,0);
  transition: transform 500ms ease-out, background-color 200ms ease-out;
}

/* Success action — covers the form after successful submit */
.success-action {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue);
  border-radius: var(--radius);
  color: var(--color-white);
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease-out, background-color 200ms ease;
}

.success-action:hover {
  background-color: var(--color-blue-light);
}

.input-container.state-success .success-action {
  opacity: 1;
  pointer-events: auto;
}

/* Error message — slides up from below the form */
.btn-message {
  position: absolute;
  z-index: 300;
  top: 100%;
  left: 0;
  height: 100%;
  width: 100%;
  text-align: center;
  line-height: var(--input-height);
  color: var(--color-white);
  pointer-events: none;
  cursor: pointer;
}

.btn-message > span {
  font-size: 1.2em;
}

.js-error {
  opacity: 0;
  transition: none;
}

.js-error.visible {
  opacity: 1;
  transform: translateY(-100%);
  transition: opacity 250ms ease-out, transform 350ms ease-out;
}

/* Spinner */
.btn-spinner {
  position: absolute;
  z-index: 300;
  display: table;
  top: 50%;
  left: 50%;
  height: 2rem;
  width: 2rem;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

.btn-spinner::before {
  display: table-cell;
  vertical-align: middle;
  transform-origin: center;
  font-size: 2.5em;
  height: 2em;
  width: 2em;
  backface-visibility: hidden;
}

.btn-spinner.in {
  animation: spinnerIn 500ms ease-in forwards;
}

.btn-spinner.in::before {
  animation: wiggle 1s infinite ease-in;
}

.btn-spinner.out {
  opacity: 1;
  animation: spinnerOut 400ms ease-out forwards;
}

.btn-spinner.out::before {
  animation-play-state: paused;
}

/* iPhone mockup */
.iphone-container {
  height: 70%;
  width: 100%;
  max-width: 32em;
  padding-top: 5%;
  margin: 0 auto;
  user-select: none;
}

.iphone {
  max-width: 100%;
  max-height: 100%;
  vertical-align: bottom;
  pointer-events: none;
}

/* Footer */
footer {
  padding: 1.5em;
  text-align: center;
  color: var(--color-grey-80);
  border-top: 1px solid var(--color-grey-80);
}

.dispatch-stamp {
  width: 10em;
  margin: 0 auto;
  text-decoration: none;
}

.dispatch-stamp:hover {
  cursor: pointer;
}

.dispatch-stamp:hover .dispatch-logo {
  color: var(--color-blue-lighter);
  transition: color 200ms ease-in;
}

.dispatch-stamp:hover .dispatch-link {
  color: var(--color-blue-lighter);
  border-color: var(--color-blue-lighter);
  transition: color 200ms ease-in, border-color 200ms ease-in;
}

.dispatch-logo {
  display: block;
  width: 3.5em;
  margin: 0 auto;
  color: var(--color-grey-88);
  transition: color 200ms ease-out;
  text-decoration: none;
}

.dispatch-logo > i::before {
  font-size: 3.5em;
}

.dispatch-text {
  display: block;
  margin: 0.75em auto;
  color: var(--color-grey-80);
  text-decoration: none;
}

.dispatch-link {
  color: var(--color-grey-80);
  font-weight: 400;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 200ms ease-out, border-color 200ms ease-out;
}

.dispatch-anchor {
  text-decoration: none;
  color: #147bb7;
  font-weight: 600;
}

.u-fw200 {
  font-weight: 200;
}

/* Animations */
@keyframes spinnerIn {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 1; }
  90% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes spinnerOut {
  0% { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -150%) scale(1); opacity: 0; }
}

@keyframes wiggle {
  0% { transform: translate3d(0, 0, 0); }
  15% { transform: rotateZ(-8deg) translate3d(0, 0, 0); }
  30% { transform: rotateZ(5deg) translate3d(0, 0, 0); }
  45% { transform: rotateZ(-5deg) translate3d(0, 0, 0); }
  60% { transform: rotateZ(3deg) translate3d(0, 0, 0); }
  75% { transform: rotateZ(-2deg) translate3d(0, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* Large phones */
@media screen and (max-width: 500px) {
  body {
    font-size: 12px;
  }

  .main {
    padding: 2.5em 0;
  }

  .masthead {
    padding: 0 1.5em;
  }

  .heading {
    font-size: 1.75em;
    line-height: 1.75em;
  }

  .marketing {
    width: 90%;
  }

  .input {
    font-size: 1rem;
  }
}

/* Small phones */
@media screen and (max-width: 345px) {
  :root {
    --input-height: 4em;
    --btn-width: 40%;
  }

  .header {
    height: 5em;
  }

  .partner-logo {
    transform: translate(-50%, -50%) scale(0.75);
  }

  .main {
    padding: 2em 0;
  }

  .masthead {
    padding: 0 1em;
  }

  .heading {
    margin: 0 auto 1em;
  }

  .input {
    width: 60%;
    font-size: 0.825rem;
  }

  .btn-background.animated {
    transform: scaleX(2.5) translate3d(0,0,0);
  }
}

@media screen and (max-width: 450px) {
  .input-container {
    width: 100%;
  }
}

@media screen and (max-width: 450px) and (max-height: 515px) {
  .heading {
    font-size: 1.65em;
  }
}
