/* ==========================================================================
   Skewl — login page styles
   Self-contained (no external resources). Shares the Skewl design tokens
   with the main app so every page reads as one product.
   ========================================================================== */

:root {
  /* Skewl design language */
  --sk-bg: #0a1428;
  --sk-bg-2: #0b1832;
  --sk-surface: #12203f;
  --sk-surface-2: #14244a;
  --sk-surface-3: #1a2c52;
  --sk-glass: rgba(22, 25, 40, .62);
  --sk-border: rgba(255, 255, 255, .08);
  --sk-border-strong: rgba(255, 255, 255, .14);
  --sk-text: #e8eefb;
  --sk-text-2: #9db0d6;
  --sk-text-3: #6d7ea3;
  --sk-accent: #315fe8;
  --sk-accent-2: #4f8ef7;
  --sk-accent-3: #63b3ff;
  --sk-accent-soft: rgba(49, 95, 232, .16);
  --sk-grad: linear-gradient(135deg, #315fe8 0%, #4f8ef7 55%, #f4709b 100%);
  --sk-grad-cool: linear-gradient(135deg, #63b3ff 0%, #315fe8 100%);
  --sk-danger: #ff6b81;
  --sk-warn: #ffc760;
  --sk-success: #4ee3a4;
  --sk-radius-sm: 8px;
  --sk-radius: 12px;
  --sk-radius-lg: 18px;
  --sk-radius-xl: 26px;
  --sk-shadow: 0 20px 50px -18px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .35);
  --sk-glow: 0 0 0 1px rgba(49, 95, 232, .35), 0 10px 40px -10px rgba(49, 95, 232, .55);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --transition-fast: .15s ease;
  --transition-med: .25s var(--ease-out);

  color-scheme: dark;
}

/* Deliberate: the login page ships dark-only. The light branch re-declares
   the same palette so that choice is explicit rather than an omission. */
[data-theme="light"] {
  --sk-bg: #0a1428;
  --sk-bg-2: #0b1832;
  --sk-surface: #12203f;
  --sk-glass: rgba(22, 25, 40, .62);
  --sk-text: #e8eefb;
  --sk-text-2: #9db0d6;
  --sk-text-3: #6d7ea3;
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--sk-bg);
  color: var(--sk-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(49, 95, 232, .45);
  color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Decorative background: aurora blobs + dot grid + vignette               */
/* ---------------------------------------------------------------------- */

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(49, 95, 232, .10), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(79, 216, 255, .06), transparent 60%),
    linear-gradient(180deg, var(--sk-bg-2) 0%, var(--sk-bg) 100%);
}

.bg-decor::after {
  /* soft vignette to focus the card */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 45%, rgba(3, 4, 8, .75) 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 30%, transparent 85%);
  opacity: .7;
}

.bg-noise {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(ellipse 50% 40% at 50% 45%, #000 10%, transparent 80%);
  mask-image: radial-gradient(ellipse 50% 40% at 50% 45%, #000 10%, transparent 80%);
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .65;
  will-change: transform;
  mix-blend-mode: screen;
}

.bg-blob-a {
  width: 620px;
  height: 620px;
  top: -220px;
  left: -160px;
  background: radial-gradient(circle at 40% 40%, rgba(49, 95, 232, .75), rgba(49, 95, 232, 0) 65%);
  animation: drift-a 24s ease-in-out infinite alternate;
}

.bg-blob-b {
  width: 560px;
  height: 560px;
  bottom: -220px;
  right: -140px;
  background: radial-gradient(circle at 60% 60%, rgba(244, 112, 155, .55), rgba(79, 142, 247, .2) 45%, rgba(79, 142, 247, 0) 70%);
  animation: drift-b 28s ease-in-out infinite alternate;
}

.bg-blob-c {
  width: 440px;
  height: 440px;
  top: 38%;
  left: 58%;
  background: radial-gradient(circle, rgba(79, 216, 255, .42), rgba(79, 216, 255, 0) 68%);
  opacity: .45;
  animation: drift-c 32s ease-in-out infinite alternate;
}

@keyframes drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(90px, 60px) scale(1.12); }
  100% { transform: translate(40px, 130px) scale(.96); }
}

@keyframes drift-b {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-80px, -50px) scale(1.08); }
  100% { transform: translate(-150px, 10px) scale(1.14); }
}

@keyframes drift-c {
  0%   { transform: translate(-50%, -50%) scale(.9); }
  50%  { transform: translate(-80%, -30%) scale(1.1); }
  100% { transform: translate(-30%, -70%) scale(1); }
}

/* ---------------------------------------------------------------------- */
/* Layout                                                                  */
/* ---------------------------------------------------------------------- */

.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  padding: 40px 38px 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045) 0%, rgba(255, 255, 255, 0) 40%),
    var(--sk-glass);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius-xl);
  box-shadow:
    var(--sk-shadow),
    0 40px 120px -40px rgba(49, 95, 232, .35),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  isolation: isolate;
  animation: card-in .7s var(--ease-out) both;
}

/* gradient hairline border */
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(49, 95, 232, .55), rgba(255, 255, 255, .06) 30%, rgba(255, 255, 255, .02) 65%, rgba(244, 112, 155, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: -1;
}

/* soft top glow bar */
.card-glow {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 62%;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(79, 142, 247, .95), rgba(79, 216, 255, .8), transparent);
  box-shadow: 0 0 22px 2px rgba(79, 142, 247, .45);
  pointer-events: none;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(.97); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* staggered entrance for card contents */
.login-card > .brand,
.login-card > .login-title,
.login-card > .login-subtitle,
.login-card > form {
  animation: rise-in .6s var(--ease-out) both;
}
.login-card > .brand          { animation-delay: .10s; }
.login-card > .login-title    { animation-delay: .16s; }
.login-card > .login-subtitle { animation-delay: .21s; }
.login-card > form            { animation-delay: .27s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------- */
/* Brand                                                                   */
/* ---------------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  flex: none;
  line-height: 0;
  border-radius: 11px;
  filter: drop-shadow(0 8px 18px rgba(49, 95, 232, .45)) drop-shadow(0 0 1px rgba(255, 255, 255, .3));
  transition: transform var(--transition-med);
}

.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.05);
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
  color: var(--sk-text);
  background: var(--sk-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------------------------------------------------------------------- */
/* Heading                                                                 */
/* ---------------------------------------------------------------------- */

.login-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.6px;
  line-height: 1.15;
  color: var(--sk-text);
}

.login-subtitle {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--sk-text-2);
}

/* ---------------------------------------------------------------------- */
/* Banners                                                                 */
/* ---------------------------------------------------------------------- */

.banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 11px 12px 11px 38px;
  font-size: 13px;
  line-height: 1.45;
  border-radius: var(--sk-radius);
  border: 1px solid transparent;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: banner-in .35s var(--ease-out);
}

.banner::after {
  /* status glyph */
  content: "i";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font: 700 10.5px/1 var(--font);
  border-radius: 50%;
  color: var(--sk-bg);
  background: currentColor;
}

@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.banner.hidden {
  display: none;
}

.banner-info {
  color: #bcd4ff;
  background: linear-gradient(135deg, rgba(49, 95, 232, .16), rgba(79, 216, 255, .08));
  border-color: rgba(49, 95, 232, .38);
  box-shadow: 0 8px 24px -14px rgba(49, 95, 232, .6);
}

.banner-info::after {
  background: var(--sk-accent);
  color: #fff;
}

.banner-error {
  color: #ffb3bf;
  background: linear-gradient(135deg, rgba(255, 107, 129, .16), rgba(255, 107, 129, .06));
  border-color: rgba(255, 107, 129, .42);
  box-shadow: 0 8px 24px -14px rgba(255, 107, 129, .6);
  animation: banner-in .35s var(--ease-out), shake .42s cubic-bezier(.36, .07, .19, .97) .05s;
}

.banner-error::after {
  content: "!";
  background: var(--sk-danger);
  color: #1a0710;
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.banner-dismiss {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -2px -3px -2px 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 6px;
  opacity: .7;
  cursor: pointer;
  transition: opacity var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.banner-dismiss:hover {
  opacity: 1;
  background: rgba(255, 255, 255, .1);
  transform: rotate(90deg);
}

.banner-dismiss:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
  opacity: 1;
}

/* ---------------------------------------------------------------------- */
/* Form fields                                                             */
/* ---------------------------------------------------------------------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--sk-text-2);
  transition: color var(--transition-fast);
}

.field:focus-within label {
  color: #bcd4ff;
}

.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--sk-text);
  caret-color: var(--sk-accent-2);
  background: rgba(8, 9, 16, .55);
  border: 1px solid var(--sk-border-strong);
  border-radius: var(--sk-radius);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-med);
}

.field input::placeholder {
  color: var(--sk-text-3);
}

.field input[type="text"]:hover,
.field input[type="password"]:hover {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(14, 16, 26, .7);
}

.field input[type="text"]:focus,
.field input[type="password"]:focus {
  background: rgba(16, 18, 30, .85);
  border-color: rgba(49, 95, 232, .85);
  box-shadow:
    0 0 0 4px rgba(49, 95, 232, .18),
    0 0 24px -4px rgba(49, 95, 232, .45),
    inset 0 1px 2px rgba(0, 0, 0, .35);
}

/* Chrome autofill: keep it on-palette */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--sk-text);
  -webkit-box-shadow: 0 0 0 1000px #12203f inset;
  caret-color: var(--sk-accent-2);
  transition: background-color 9999s ease-out;
}

.field.field-invalid label {
  color: #ff9fae;
}

.field.field-invalid input,
.field.field-invalid input:hover {
  border-color: rgba(255, 107, 129, .75);
}

.field.field-invalid input:focus {
  border-color: var(--sk-danger);
  box-shadow:
    0 0 0 4px rgba(255, 107, 129, .18),
    0 0 24px -6px rgba(255, 107, 129, .45);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 50px !important;
}

.toggle-password {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--sk-text-3);
  background: transparent;
  border: none;
  border-radius: var(--sk-radius-sm);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.toggle-password:hover {
  color: var(--sk-text);
  background: rgba(255, 255, 255, .07);
}

.toggle-password[aria-pressed="true"] {
  color: var(--sk-accent);
  background: var(--sk-accent-soft);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--sk-accent);
  outline-offset: 0;
}

/* ---------------------------------------------------------------------- */
/* Submit button                                                           */
/* ---------------------------------------------------------------------- */

.submit-btn {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(40, 10, 60, .35);
  background: var(--sk-grad);
  background-size: 160% 160%;
  background-position: 0% 50%;
  border: none;
  border-radius: var(--sk-radius);
  cursor: pointer;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    inset 0 -1px 0 rgba(0, 0, 0, .15),
    0 12px 30px -10px rgba(79, 142, 247, .6),
    0 2px 6px rgba(0, 0, 0, .3);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    background-position .6s var(--ease-out),
    opacity var(--transition-fast),
    filter var(--transition-fast);
}

/* sheen sweep */
.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: left .7s var(--ease-out);
  z-index: -1;
  pointer-events: none;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -1px 0 rgba(0, 0, 0, .15),
    0 0 0 1px rgba(79, 142, 247, .45),
    0 18px 44px -12px rgba(79, 142, 247, .75),
    0 4px 10px rgba(0, 0, 0, .3);
}

.submit-btn:hover:not(:disabled)::before {
  left: 120%;
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0) scale(.99);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 6px 16px -8px rgba(79, 142, 247, .6);
}

.submit-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--sk-bg),
    0 0 0 5px rgba(49, 95, 232, .9),
    0 14px 36px -10px rgba(79, 142, 247, .7);
}

.submit-btn:disabled {
  cursor: progress;
  filter: saturate(.85);
  opacity: .9;
}

.btn-label {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}

.submit-btn.is-loading {
  background-position: 100% 50%;
}

.submit-btn.is-loading::after {
  /* shimmering progress bar under the label */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: bar-slide 1.1s ease-in-out infinite;
}

.submit-btn.is-loading .btn-label {
  opacity: .9;
}

.submit-btn.is-loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bar-slide {
  from { background-position: -40% 0; }
  to   { background-position: 140% 0; }
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */

.login-footer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 24px 0 0;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--sk-text-3);
  text-align: center;
  background: rgba(18, 20, 31, .5);
  border: 1px solid var(--sk-border);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: rise-in .6s var(--ease-out) .4s both;
}

.login-footer svg {
  flex: none;
  color: var(--sk-accent);
}

/* ---------------------------------------------------------------------- */
/* Small screens                                                           */
/* ---------------------------------------------------------------------- */

@media (max-width: 480px) {
  .login-page {
    padding: 20px 14px;
  }

  .login-card {
    padding: 30px 22px 26px;
    border-radius: var(--sk-radius-lg);
  }

  .brand {
    margin-bottom: 24px;
  }

  .login-title {
    font-size: 24px;
  }

  .bg-blob-a { width: 420px; height: 420px; }
  .bg-blob-b { width: 380px; height: 380px; }
  .bg-blob-c { width: 300px; height: 300px; }
}

@media (max-width: 360px) {
  .login-card {
    padding: 26px 16px 22px;
  }

  .login-footer {
    font-size: 11px;
    padding: 6px 11px;
  }
}

/* Browsers without backdrop-filter: make the glass opaque enough to read */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .login-card {
    background: rgba(18, 20, 31, .96);
  }
}

/* ---------------------------------------------------------------------- */
/* Reduced motion                                                          */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }

  .bg-blob {
    animation: none !important;
  }

  .btn-spinner {
    /* keep a visible (slow) loading indicator rather than a frozen ring */
    animation: spin 1.6s linear infinite !important;
  }

  .submit-btn:hover:not(:disabled),
  .brand:hover .brand-mark {
    transform: none;
  }
}
