/* ─────────────────────────────────────────
   Design tokens
───────────────────────────────────────── */
:root {
  --dark-blue:  #217093;
  --med-blue:   #4eb8dd;
  --light-blue: #ddf1fa;
  --input-bg:   #f3fafd;
  --error-red:  #e53935;
  --error-black: #1a1a1a;
  --radius-sm: 4px;
  --radius-md: .5em;
}

/* ─────────────────────────────────────────
   Reset / Base
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { width: 100%; height: 100%; }

body {
  background-color: #eff3f4;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  font-size: 16px;
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────
   Form card
───────────────────────────────────────── */
form {
  position: relative;
  display: block;
  width: 100%;
  max-width: 400px;
  background-color: #fff;
  margin: 0;
  padding: 2.25em;
  border: solid 1px #ddd;
  border-radius: var(--radius-md);
  font-family: 'Source Sans Pro', sans-serif;
  box-shadow: 0 8px 32px rgba(33, 112, 147, .12);
}

/* ─────────────────────────────────────────
   SVG Avatar container
───────────────────────────────────────── */
.svgContainer {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 1em;
  border-radius: 50%;
  pointer-events: none;
}

.svgContainer div {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
  border-radius: 50%;
  padding-bottom: 100%;
}

.mySVG {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.svgContainer::after {
  content: "";
  position: absolute; top: 0; left: 0;
  z-index: 10;
  width: inherit; height: inherit;
  box-sizing: border-box;
  border: solid 2.5px var(--dark-blue);
  border-radius: 50%;
}

/* ─────────────────────────────────────────
   Input groups
───────────────────────────────────────── */
.inputGroup {
  margin: 0 0 2em;
  padding: 0;
  position: relative;
}

.inputGroup:last-of-type {
  margin-bottom: 0;
}

label {
  margin: 0 0 12px;
  display: block;
  font-size: 1.25em;
  color: var(--dark-blue);
  font-weight: 700;
  font-family: inherit;
}

input[type='email'],
input[type='text'],
input[type='number'],
input[type='url'],
input[type='search'],
input[type='password'] {
  display: block;
  margin: 0;
  padding: .875em 1em 0;
  background-color: var(--input-bg);
  border: solid 2px var(--dark-blue);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  width: 100%;
  height: 65px;
  font-size: 1.55em;
  color: #353538;
  font-weight: 600;
  font-family: inherit;
  transition: box-shadow .2s linear, border-color .25s ease-out;
}

input[type='email']:focus,
input[type='text']:focus,
input[type='number']:focus,
input[type='url']:focus,
input[type='search']:focus,
input[type='password']:focus {
  outline: none;
  box-shadow: 0px 2px 10px rgba(0,0,0,.1);
  border: solid 2px var(--med-blue);
}

/* Placeholder styling */
input::placeholder {
  color: var(--dark-blue);
  opacity: .45;
  font-weight: 400;
  font-size: .7em;
}

/* ─────────────────────────────────────────
   Login button
───────────────────────────────────────── */
button {
  display: block;
  margin: 0;
  padding: .65em 1em 1em;
  background-color: var(--med-blue);
  border: none;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  box-shadow: none;
  width: 100%;
  height: 65px;
  font-size: 1.55em;
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .2s ease-out, transform .1s ease;
}

button:hover, button:active {
  background-color: var(--dark-blue);
}

button:active {
  transform: scale(.98);
}

/* ─────────────────────────────────────────
   Floating label (username group)
───────────────────────────────────────── */
.inputGroup1 .helper {
  position: absolute;
  z-index: 1;
  font-family: inherit;
}

.inputGroup1 .helper1 {
  top: 0; left: 0;
  transform: translate(1em, 2.2em) scale(1);
  transform-origin: 0 0;
  color: var(--dark-blue);
  font-size: 1.55em;
  font-weight: 400;
  opacity: .65;
  pointer-events: none;
  transition: transform .2s ease-out, opacity .2s linear;
}

.inputGroup1.focusWithText .helper {
  transform: translate(1em, 1.55em) scale(.6);
  opacity: 1;
}

/* ─────────────────────────────────────────
   Password group
───────────────────────────────────────── */
.inputGroup2 input[type="password"] {
  padding: .4em 1em .5em;
}

.inputGroup2 input[type="text"] {
  padding: .025em 1em 0;
}

#showPasswordToggle {
  display: block;
  padding: 0 0 0 1.45em;
  position: absolute;
  top: .25em; right: 0;
  font-size: 1em;
}

#showPasswordToggle input {
  position: absolute;
  z-index: -1;
  opacity: 0;
}

.indicator {
  position: absolute; top: 0; left: 0;
  height: .85em; width: .85em;
  background-color: var(--input-bg);
  border: solid 2px var(--dark-blue);
  border-radius: 3px;
}

.indicator::after {
  content: "";
  position: absolute;
  left: .25em; top: .025em;
  width: .2em; height: .5em;
  border: solid var(--dark-blue);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  visibility: hidden;
}

#showPasswordCheck:checked ~ .indicator::after { visibility: visible; }
#showPasswordCheck:focus ~ .indicator,
#showPasswordCheck:hover ~ .indicator { border-color: var(--med-blue); }
#showPasswordCheck:disabled ~ .indicator { opacity: .5; }
#showPasswordCheck:disabled ~ .indicator::after { visibility: hidden; }

/* ─────────────────────────────────────────
   Error message
───────────────────────────────────────── */
.error-message {
  margin: 1.25em 0 0;
  padding: .6em 1em;
  border-radius: var(--radius-sm);
  font-size: 1em;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  background: rgba(0,0,0,.04);
  transition: color .25s ease, opacity .3s ease;
  animation: fadeInDown .3s ease;
}

/* odd click → red */
.error-message.error-odd  { color: var(--error-red); }

/* even click → black */
.error-message.error-even { color: var(--error-black); }

/* login success → green */
.error-message.error-success {
  color: #1b7a3e;
  background: rgba(27, 122, 62, .08);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
