:root {
  --midnight: #030509;
  --steel: #818a91;
  --silver: #dfdfd0;
  --gallery: #f3f3f3;
  --mercury: #f0f0f0;
  --sea: #006fd1;
  --cerulean: #0096ff;
  --azure: #07f;
  --polar: #f0f8fc;
  --ice: #e5f3fb;
  --ion-header-height: 46px;
}

html,
body,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  padding: 0;
  border: 0;
  margin: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

html {
  font-size: 62.5%;
}

body {
  background-color: #fff;
  line-height: 1;
  font-family: var(--font-sans, sans-serif);
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

.ion-header {
  position: fixed;
  z-index: 2;
  display: flex;
  height: var(--ion-header-height);
  align-items: center;
  border-bottom: 1px solid var(--mercury);
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
  inset: 0 0 auto;

  & > div {
    height: 22px;
    flex: 1;
    margin: 0 1.5rem;
    background: url('./ion-analytics.svg') 0 50% no-repeat;
    background-size: contain;

    & span {
      font-size: 0;
      opacity: 0;
    }
  }
}

.page-wrapper {
  display: flex;
  height: 100vh;
  min-height: max(500px, 100dvh);
  box-sizing: border-box;
  flex-direction: column;
  justify-content: space-between;

  & .mainBody {
    flex: 1;
  }

  & .mainCentral {
    display: flex;
    width: min(420px, 90vw);
    height: 100%;
    flex-direction: column;
    margin: 0 auto;
    gap: 2rem;
    place-content: center center;
  }
}

/* in case there is a ion header, add some padding to the top */
body:has(.ion-header) {
  & .page-wrapper {
    padding-top: calc(var(--ion-header-height) + 1.5rem);
  }
}

#mainTitle {
  padding: 1em 0;
  font-size: 1.4rem;

  & .dealogic {
    margin: 0 0 4.5rem;

    & h1 {
      height: 30px;
      background: url('./dealogic.png') 0 50% no-repeat;
      background-size: contain;

      & span {
        font-size: 0;
        opacity: 0;
      }
    }
  }

  & p {
    margin: 0;

    & + p {
      margin-top: 0.35em;
    }
  }
}

.mainBody form {
  padding: 3rem;
  border: 1px solid var(--gallery);
  border-radius: 5px;
  box-shadow:
    0 4px 4px rgb(0 0 0 / 1.7%),
    0 7px 11px rgb(0 0 0 / 2.5%),
    0 12px 26px rgb(0 0 0 / 3.3%),
    0 26px 80px rgb(0 0 0 / 5%);
  font-size: 1.4rem;

  & fieldset .dl-field {
    margin-bottom: 16px;
  }

  /* disable colored background on auto-fill */
  & input {
    transition: background 5000s 10s ease !important;
  }

  & dl-input {
    display: block;
    width: 100%;
  }

  & dl-input[type='password'] {
    & input {
      font-family: Verdana, sans-serif;
      letter-spacing: 0.1em;
    }
  }

  & .dl-select {
    position: relative;
    border: 1px solid var(--silver);
    border-radius: 3px;
    transition: all 0.3s ease;

    &:focus-within {
      border-color: var(--cerulean);
    }

    &::after {
      position: absolute;
      top: 50%;
      right: 12px;
      display: inline-block;
      border: 4px solid transparent;
      border-radius: 3px;
      border-top-color: var(--midnight);
      content: '';
      translate: 0 -25%;
    }

    & select {
      display: block;
      width: 100%;
      padding: 8px 12px;
      border: 0;
      appearance: none;
      background: transparent;
      font-family: inherit;
      font-size: 12px;
      line-height: 1.33;

      &:focus {
        outline: none;
      }
    }
  }

  & fieldset.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3rem 0 0;
    gap: 3rem;
  }

  & label.dl-checkbox {
    margin: 0;

    & .label {
      font-size: 92%;
    }
  }
}

.forgot-password {
  margin: 3rem 0 0;
  text-align: center;

  & a {
    display: inline-block;
    color: var(--cerulean);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

.footer {
  --color: var(--steel);

  padding: 4em 2em 1em;
  color: var(--color);
  font-size: 12px;
  text-align: center;

  & .support,
  & .disclaimer,
  & .dealogicLink {
    margin: 1.5rem 0 0;
    color: var(--color);

    & p {
      margin: 0;
      color: var(--color);
    }

    &:empty {
      display: none;
    }

    &:not(:has(> *)) {
      display: none;
    }
  }

  & .support {
    --color: var(--midnight);

    display: block;
    width: min(420px, 90vw);
    box-sizing: border-box;
    padding: 1.5rem;
    border: 1px solid var(--ice);
    border-radius: 5px;
    margin: 1.5rem auto 3rem;
    background: var(--polar);

    /* max-height: 6lh; */
    overflow-y: auto;
    text-align: left;

    & .login-support-details {
      white-space: pre-wrap;
    }

    & .supportEmail {
      margin-top: 0.6em;
      font-weight: bold;
    }
  }

  & a {
    color: var(--color);
    text-decoration: underline;

    &:hover {
      color: var(--cerulean);
    }
  }
}

form[name='frmForgot'] {
  padding: calc(var(--ion-header-height) + 14px) 14px 14px;

  & .header {
    position: fixed;
    z-index: 2;
    display: flex;
    height: var(--ion-header-height);
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid var(--mercury);
    background: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
    inset: 0 0 auto;
  }

  & article {
    & p {
      /* margin: 0; */
      line-height: 1.1;

      & + p {
        /* margin-top: .75em; */
      }

      &:empty {
        display: none;
      }
    }
  }

  & div.modes {
    display: flex;
    flex-direction: column;
    margin: 3rem 0 1.5rem;
    gap: 1rem;
  }

  & fieldset.username,
  & fieldset.userid,
  & fieldset.actions {
    display: flex;
    width: 34rem;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
  }

  & fieldset.username,
  & fieldset.userid {
    gap: 0.5rem;

    & > label.dl-radio {
      flex: 1;
    }

    & .dl-field {
      display: flex;
      align-items: center;
      gap: 1rem;

      & > label {
        display: none;
        padding: 0;
      }
    }

    &:has(input[disabled]) {
      & .dl-field {
        opacity: 0.5;
      }
    }
  }

  & fieldset.actions {
    justify-content: flex-end;
  }
}
