/* ---------------------------------------------------------------------------
   Skatlantis theme for the Authelia login page.

   Injected by nginx into Authelia's own HTML. Most of the work is done by
   overriding its design tokens rather than fighting its class names, so an
   Authelia update that reshuffles markup will at worst cost the chunky card
   and leave the colours intact.
   --------------------------------------------------------------------------- */

:root{
  /* Authelia's tokens, repainted in the house palette. */
  --background:            #c9ecff;
  --foreground:            #16324a;

  --card:                  #ffffff;
  --card-foreground:       #16324a;
  --popover:               #ffffff;
  --popover-foreground:    #16324a;

  --primary:               #16324a;
  --primary-foreground:    #ffffff;
  --secondary:             #ff8a5c;
  --secondary-foreground:  #ffffff;

  --muted:                 #eaf6ff;
  --muted-foreground:      #4a6b88;
  --accent:                #ffd23f;
  --accent-foreground:     #16324a;

  --destructive:           #ff6b4a;
  --destructive-foreground:#ffffff;
  --success:               #5cc47f;
  --success-foreground:    #16324a;
  --warning:               #ffd23f;
  --warning-foreground:    #16324a;
  --info:                  #7cc6ff;
  --info-foreground:       #16324a;

  --border:                #16324a;
  --input:                 #16324a;
  --ring:                  #ffd23f;
  --divider:               rgba(22,50,74,.18);

  --custom-icon:           #16324a;
  --custom-loading-bar:    #16324a;

  --radius:                1rem;
}

html, body{
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display",
               "Segoe UI", system-ui, -apple-system, sans-serif !important;
  color: #16324a;
}

/* The sky, as on the portal. Fixed so it does not scroll away on a phone. */
body{
  background: linear-gradient(180deg, #8ed6ff 0%, #c9ecff 55%, #c9ecff 100%) !important;
  background-attachment: fixed !important;
  min-height: 100vh;
}

/* Hills along the bottom. Inline SVG so nothing is fetched from anywhere. */
body::after{
  content:"";
  position: fixed; left: 0; right: 0; bottom: 0; height: 30vh;
  pointer-events: none; z-index: 0;
  /* Angle brackets are percent-encoded: Chrome refuses a data URI that
     carries them raw, and silently renders nothing. */
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 300' preserveAspectRatio='none'%3E%3Cpath d='M0,150 C180,80 300,200 480,150 C660,100 780,210 960,160 C1080,128 1150,150 1200,140 L1200,300 L0,300 Z' fill='%237ddb9a'/%3E%3Cpath d='M0,215 C200,170 360,250 560,215 C760,180 900,245 1080,215 C1140,205 1180,210 1200,208 L1200,300 L0,300 Z' fill='%235cc47f'/%3E%3C/svg%3E") no-repeat bottom center / 100% 100%;
}

/* Keep the form above the hills. */
#root{ position: relative; z-index: 1; }

/* ---- the card ----------------------------------------------------------- */
/* Authelia centres the form in a 444px column. Turned into one of the
   portal's chunky cards: thick outline, hard shadow, generous radius. */
[class*="max-w-[444px]"]{
  background: #ffffff;
  border: 4px solid #16324a;
  border-radius: 28px;
  box-shadow: 0 10px 0 #16324a, 0 18px 28px rgba(22,50,74,.22);
  padding-top: 1.4rem !important;
  padding-bottom: 1.8rem !important;
}

/* The house name, above the card. Authelia has no branding slot, so it is
   drawn here rather than by replacing its markup. */
[class*="max-w-[444px]"]::before{
  content: "Skatlantis";
  display: block;
  margin: -0.1rem 0 .1rem;
  font-size: clamp(2.1rem, 7vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1;
  color: #16324a;
}

/* Authelia's generic avatar sits where the name now goes. */
[class*="max-w-[444px]"] svg:first-of-type{ display: none; }

/* ---- fields ------------------------------------------------------------- */
input.peer{
  border-width: 3px !important;
  border-radius: 14px !important;
  border-color: #16324a !important;
  font-weight: 700 !important;
  background: #ffffff !important;
}
input.peer:focus{
  border-color: #ff8a5c !important;
  box-shadow: 0 0 0 4px rgba(255,210,63,.55) !important;
}

/* ---- buttons ------------------------------------------------------------ */
button{
  border-radius: 999px !important;
  font-weight: 900 !important;
  letter-spacing: -.01em;
}
button[type="submit"]{
  border: 3px solid #16324a !important;
  box-shadow: 0 5px 0 #16324a !important;
  padding-top: .7rem !important; padding-bottom: .7rem !important;
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), box-shadow .14s ease !important;
}
button[type="submit"]:hover{
  transform: translateY(-3px);
  box-shadow: 0 8px 0 #16324a !important;
}
button[type="submit"]:active{
  transform: translateY(3px);
  box-shadow: 0 2px 0 #16324a !important;
}

/* ---- headings and links ------------------------------------------------- */
h1, h2, h3{ font-weight: 900 !important; letter-spacing: -.02em; }
a{ font-weight: 800 !important; }

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}

/* ---- the one-time code -------------------------------------------------
   Authelia renders the six boxes as real inputs inside span#otp-input.
   Only the first carries maxlength, and it is 6, so the boxes can only be
   addressed through that id. Its own styling is size-10 with a 1px grey
   border, which disappears against the card. */
#otp-input,
#otp-input > *{
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: .15rem !important;
}
#otp-input input{
  flex: 0 0 auto !important;
  width: 2.9rem !important;
  height: 3.2rem !important;
  margin: 0 .22rem !important;
  border: 3px solid #16324a !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  font-weight: 900 !important;
  font-size: 1.35rem !important;
  text-align: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}
#otp-input input:focus{
  border-color: #ff8a5c !important;
  box-shadow: 0 0 0 4px rgba(255,210,63,.55) !important;
  outline: none !important;
}

/* Keep the whole card in the middle of the window, not just the top half. */
body > #root > div,
[class*="min-h-[90vh]"]{
  min-height: 100vh !important;
  align-items: center !important;
}

/* The countdown ring above the boxes keeps its 64px slot even when hidden,
   which leaves a hole under the title. Collapse the wrapper it sits in.
   The panel itself is excluded, or the whole code box would vanish with it. */
[class*="max-w-[444px]"] *:has(> svg[width="64"][height="64"]):not(:has(#otp-input)){
  display: none !important;
}
