/* ============================================================
   auth.css - the account verification and one-time code screens.

   Scoped under .db-root so nothing here reaches the rest of the
   application, which is still laid out by Bootstrap 3.3.7.

   Loaded only by Views/Home/Index.cshtml and Views/Home/VerifyPin.cshtml.
   ============================================================ */

/* Tokens are shared with dashboard.css, which scopes its components
   under .db-page. */
.db-shell,
.db-page {
  --g-deep:    #0B2A1C;
  --g-brand:   #157941;
  --g-bright:  #1E9A55;
  --ivory:     #FAF7F0;
  --brass:     #C08A2E;
  --ink:       #14201A;
  --ink-soft:  #4A574F;
  --rule:      #DED7C8;
  --on-deep:   #E9F0E9;
  --on-deep-2: #A8BFB0;
  --danger:    #A6402F;

  max-width: 1080px;
  /* The fixed header in _Welcome.cshtml sizes its logo at 15% of the viewport,
     so its height grows with the window and a fixed clearance will not do.
     This tracks it, with headroom at both ends. */
  margin: clamp(90px, 8vw, 170px) auto 64px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .75),
              0 0 0 1px rgba(255, 255, 255, .10);
}

/* The layout paints a photograph of the office behind every page. Left alone
   it competes with the form; darkened, it becomes atmosphere and the card
   becomes the thing you look at. */
.db-scrim {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 42%, rgba(6, 26, 17, .40), rgba(6, 26, 17, .80) 70%),
    linear-gradient(180deg, rgba(6, 26, 17, .55), rgba(6, 26, 17, .78));
}

.db-root {
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.55;
  display: -ms-grid;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr);
  min-height: 540px;
}

.db-root *,
.db-root *:before,
.db-root *:after { box-sizing: border-box; }

/* site.css caps every input in the application at 280px. These screens
   opt out; the rule stays in force everywhere else. */
.db-root input,
.db-root select,
.db-root textarea { max-width: none; }

/* ---------- left: the assurance panel ---------- */
.db-aside {
  background: var(--g-deep);
  color: var(--on-deep);
  padding: 40px 38px 34px;
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

/* Soft light over the dark panel. */
.db-aside:before {
  content: "";
  position: absolute;
  top: -40%; right: -10%; left: -10%;
  height: 150%;
  background:
    radial-gradient(ellipse 60% 50% at 78% 18%, rgba(30,154,85,.42), transparent 70%),
    radial-gradient(ellipse 50% 40% at 8% 92%, rgba(192,138,46,.20), transparent 72%);
  pointer-events: none;
}

.db-aside > * { position: relative; }

/* The supplied logo is dark green on transparent, so it cannot sit on the
   dark panel. A text lockup is used here; the real logo appears on the
   light background of the compact mobile header. */
.db-wordmark {
  display: block;
  margin-bottom: 40px;
  padding-left: 14px;
  border-left: 3px solid var(--brass);
}

.db-wordmark .db-name {
  display: block;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  line-height: 1.1;
}

.db-wordmark small {
  display: block;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--on-deep-2);
  margin-top: 3px;
}

.db-aside h1 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: -.012em;
  margin: 0 0 12px;
  color: var(--on-deep);
}

.db-aside h1 em { font-style: italic; color: #86D3A6; }

.db-lede {
  color: var(--on-deep-2);
  font-size: 15px;
  margin: 0 0 30px;
  max-width: 36ch;
}

.db-checklist-title {
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}

.db-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.db-checklist li {
  position: relative;
  padding-left: 29px;
  margin-bottom: 13px;
  font-size: 13.6px;
  line-height: 1.45;
  color: var(--on-deep);
}

.db-checklist li svg {
  position: absolute;
  left: 0; top: 1px;
  width: 18px; height: 18px;
}

.db-checklist strong { font-weight: 600; }
.db-checklist span { color: var(--on-deep-2); }

.db-help {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.13);
  font-size: 12.8px;
  color: var(--on-deep-2);
}

.db-help a {
  color: #86D3A6;
  text-decoration: none;
  border-bottom: 1px solid rgba(134,211,166,.4);
}

.db-help a:hover, .db-help a:focus { color: #A8E4C2; }
.db-help strong { color: var(--on-deep); font-weight: 600; }

/* ---------- right: the form ---------- */
.db-main {
  background: var(--ivory);
  padding: 40px 44px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  position: relative;
}

.db-main:after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(rgba(20,32,26,.035) 1px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
}

.db-main > * { position: relative; }
.db-main form { margin: 0; }

.db-steps {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-bottom: 22px;
}

.db-step-dot {
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--g-brand);
  background: rgba(21,121,65,.09);
  border: 1px solid rgba(21,121,65,.28);
  border-radius: 20px;
  padding: 3px 11px;
}

.db-step-rail {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin: 0 9px;
}

.db-step-of {
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: #8D9A91;
  letter-spacing: .06em;
}

.db-main h2 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  color: var(--ink);
}

.db-sub {
  color: var(--ink-soft);
  font-size: 14.6px;
  margin: 0 0 26px;
  max-width: 46ch;
}

.db-field { margin-bottom: 18px; }

.db-field > label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.db-input {
  width: 100%;
  padding: 12px 14px;
  /* 16px minimum: iOS Safari zooms the viewport on focus below this. */
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  -webkit-transition: border-color .15s, box-shadow .15s;
  transition: border-color .15s, box-shadow .15s;
}

.db-input::-webkit-input-placeholder { color: #A9B2AB; }
.db-input::-moz-placeholder { color: #A9B2AB; opacity: 1; }
.db-input:-ms-input-placeholder { color: #A9B2AB; }
.db-input::placeholder { color: #A9B2AB; }

.db-input:focus {
  outline: 0;
  border-color: var(--g-brand);
  box-shadow: 0 0 0 3px rgba(21,121,65,.16);
}

.db-input.mono {
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.db-hint { font-size: 12.4px; color: #7B857D; margin: 6px 0 0; }

/* SMS / Email as cards, not a dropdown: on a phone a select for a
   binary choice opens a full modal picker. */
.db-choice {
  display: -ms-grid;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
  gap: 10px;
}

.db-choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}

.db-choice label {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin: 0;
  padding: 12px 13px;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink);
  -webkit-transition: border-color .15s, background .15s, box-shadow .15s;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.db-choice label svg {
  width: 19px; height: 19px;
  margin-right: 10px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  color: #8D9A91;
  -webkit-transition: color .15s;
  transition: color .15s;
}

.db-choice label small {
  display: block;
  font-size: 11.5px;
  color: #8D9A91;
  font-weight: 400;
}

.db-choice input:checked + label {
  border-color: var(--g-brand);
  background: rgba(21,121,65,.055);
  box-shadow: 0 0 0 2px rgba(21,121,65,.15);
}

.db-choice input:checked + label svg { color: var(--g-brand); }
.db-choice input:focus + label { outline: 2px solid var(--g-brand); outline-offset: 2px; }

.db-submit {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: -webkit-linear-gradient(top, #1E9A55, #157941);
  background: linear-gradient(180deg, #1E9A55, #157941);
  border: 0;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -8px rgba(21,121,65,.9);
  -webkit-transition: -webkit-transform .12s, box-shadow .15s, filter .15s;
  transition: transform .12s, box-shadow .15s, filter .15s;
}

.db-submit:hover, .db-submit:focus {
  color: #fff;
  -webkit-filter: brightness(1.06);
  filter: brightness(1.06);
}

.db-submit:active { -webkit-transform: translateY(1px); transform: translateY(1px); }
.db-submit:focus { outline: 2px solid var(--g-deep); outline-offset: 3px; }

.db-secure {
  text-align: center;
  margin: 16px 0 0;
  font-size: 12.4px;
  color: #7B857D;
}

.db-secure svg {
  width: 13px; height: 13px;
  vertical-align: -2px;
  margin-right: 6px;
}

/* ---------- account chip, shown on the assurance panel ---------- */
.db-account {
  display: inline-block;
  margin-bottom: 26px;
  padding: 8px 12px;
  border: 1px solid rgba(192, 138, 46, .45);
  border-radius: 6px;
  background: rgba(192, 138, 46, .10);
}

.db-account small {
  display: block;
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 2px;
}

.db-account b {
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: #fff;
}

/* ---------- action chooser ---------- */
.db-actions {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -ms-flex-direction: column;
  flex-direction: column;
}

.db-action {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-bottom: 12px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  -webkit-transition: border-color .15s, box-shadow .15s, -webkit-transform .12s;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}

.db-action:hover,
.db-action:focus {
  color: var(--ink);
  text-decoration: none;
  border-color: var(--g-brand);
  box-shadow: 0 8px 20px -12px rgba(21, 121, 65, .8);
  -webkit-transform: translateY(-1px);
  transform: translateY(-1px);
}

.db-action:focus { outline: 2px solid var(--g-brand); outline-offset: 2px; }

.db-action .db-action-icon {
  width: 44px; height: 44px;
  margin-right: 15px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(21, 121, 65, .08);
  border: 1px solid rgba(21, 121, 65, .20);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  color: var(--g-brand);
}

.db-action .db-action-icon svg { width: 21px; height: 21px; }

.db-action .db-action-body {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  min-width: 0;
}

.db-action .db-action-body b {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}

/* Scoped to the body, so the icon and chevron wrappers - also spans - are
   not caught by it. */
.db-action .db-action-body span {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.db-action .db-action-chev {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  margin-left: 12px;
  color: #B7C0B9;
}

.db-action .db-action-chev svg { width: 17px; height: 17px; display: block; }

/* Nothing to cancel yet: shown, but plainly unavailable, so the choice does
   not lead to an empty page. */
.db-action.is-unavailable {
  background: transparent;
  border-style: dashed;
  cursor: default;
}

.db-action.is-unavailable .db-action-icon {
  background: rgba(20, 32, 26, .04);
  border-color: var(--rule);
  color: #A9B2AB;
}

.db-action.is-unavailable .db-action-body b { color: var(--ink-soft); }
.db-action.is-unavailable .db-action-body span { color: #8D9A91; }

/* ---------- one-time code screen ---------- */
.db-otp-wrap { max-width: 400px; }

.db-sent {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  background: rgba(21,121,65,.06);
  border: 1px solid rgba(21,121,65,.2);
  border-radius: 7px;
  padding: 12px 14px;
  margin-bottom: 22px;
}

.db-sent svg {
  width: 19px; height: 19px;
  margin-right: 11px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  color: var(--g-brand);
}

.db-sent p { margin: 0; font-size: 13.6px; color: var(--ink-soft); }

.db-sent strong {
  color: var(--ink);
  font-weight: 600;
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.db-code {
  width: 100%;
  padding: 16px 10px;
  font-family: "Public Sans", "Segoe UI", Tahoma, Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: .34em;
  text-indent: .34em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}

.db-code:focus {
  outline: 0;
  border-color: var(--g-brand);
  box-shadow: 0 0 0 3px rgba(21,121,65,.16);
}

.db-code::-webkit-input-placeholder { color: #CBD3CC; }
.db-code::-moz-placeholder { color: #CBD3CC; opacity: 1; }
.db-code:-ms-input-placeholder { color: #CBD3CC; }
.db-code::placeholder { color: #CBD3CC; }

.db-meta {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 12px 2px 24px;
  font-size: 13px;
  color: #7B857D;
}

.db-meta .expiry svg {
  width: 13px; height: 13px;
  vertical-align: -2px;
  margin-right: 6px;
}

.db-meta .expired { color: var(--danger); font-weight: 600; }

.db-resend {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--g-brand);
  border-bottom: 1px solid rgba(21,121,65,.35);
}

.db-resend[disabled] {
  color: #A9B2AB;
  border-bottom-color: transparent;
  cursor: default;
}

.db-back {
  display: inline-block;
  margin-top: 18px;
  font-size: 13.2px;
  color: var(--ink-soft);
  text-decoration: none;
}

.db-back svg {
  width: 14px; height: 14px;
  vertical-align: -2px;
  margin-right: 6px;
}

.db-back:hover, .db-back:focus { color: var(--g-brand); text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet and small laptop: the split survives, tightened. */
@media (max-width: 1000px) {
  .db-shell { border-radius: 10px; }
  .db-aside { padding: 32px 28px 28px; }
  .db-main  { padding: 32px 30px; }
  .db-lede  { margin-bottom: 24px; }
  .db-checklist li { font-size: 13.2px; }
}

/* Stacked: form first, supporting material after. */
@media (max-width: 760px) {
  .db-shell { border-radius: 10px; margin: 24px auto 32px; }

  .db-root {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  /* What to have ready comes before the form, so it is read rather than
     scrolled past. */
  .db-aside { -webkit-box-ordinal-group: 2; -ms-flex-order: 1; order: 1; padding: 26px 20px 24px; }
  .db-main  { -webkit-box-ordinal-group: 3; -ms-flex-order: 2; order: 2; padding: 26px 20px 32px; }

  /* The layout's own header already carries the logo, so the wordmark here
     would be a second copy of it. The heading stays: it is the page's only
     h1, and it now leads the page. */
  .db-aside .db-wordmark,
  .db-aside .db-lede { display: none; }

  /* The code step is the exception: the input comes first there, because the
     troubleshooting notes only matter once a code has failed to arrive. */
  .db-form-first .db-main  { -webkit-box-ordinal-group: 2; -ms-flex-order: 1; order: 1; }
  .db-form-first .db-aside { -webkit-box-ordinal-group: 3; -ms-flex-order: 2; order: 2; }
  .db-form-first .db-aside h1 { display: none; }

  .db-aside h1 { font-size: 25px; margin-bottom: 20px; }
  .db-checklist-title { margin-bottom: 12px; }
  .db-checklist li { margin-bottom: 11px; }
  .db-help { margin-top: 20px; padding-top: 14px; }

  .db-main h2 { font-size: 24px; }
  .db-choice { grid-template-columns: 1fr; }
  .db-otp-wrap { max-width: none; }

  .db-code { font-size: 26px; }

  /* Comfortable touch targets. */
  .db-choice label { min-height: 58px; }
  .db-action { padding: 15px 15px; }
  .db-action .db-action-icon { width: 40px; height: 40px; margin-right: 13px; }
  .db-submit { min-height: 50px; }
  .db-resend, .db-back { min-height: 44px; line-height: 44px; }
  .db-meta { margin-bottom: 20px; }
}

/* Small phones: 320px and similar. */
@media (max-width: 380px) {
  .db-main  { padding: 22px 16px 28px; }
  .db-aside { padding: 24px 16px 22px; }
  .db-step-of { font-size: 9.5px; }
  .db-code { font-size: 23px; letter-spacing: .26em; text-indent: .26em; }
}

@media (prefers-reduced-motion: reduce) {
  .db-root * {
    -webkit-transition: none !important;
    transition: none !important;
  }
}
