/* Login — premium styling. Uses design tokens from styles.css (light mode). */

/* ===== Canvas & Card ===== */
.auth-wrap {
  min-height: calc(100dvh - 140px);
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 44px) 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, .06), transparent 60%),
    radial-gradient(1200px 600px at 100% 0%, rgba(37, 99, 235, .06), transparent 60%),
    linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.auth-card {
  width: min(560px, 100%);
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: clamp(18px, 3.4vw, 28px);
  box-shadow:
    0 18px 40px rgba(16, 24, 40, .10),
    0 2px 10px rgba(16, 24, 40, .06);
  border: 1px solid var(--border);
  overflow: clip;
}

/* Subtle animated border sheen */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, #7aa7ff, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .0;
  transition: opacity .3s ease;
}

.auth-card:hover::before {
  opacity: .35
}

/* Header */
.auth-head h1 {
  margin: 0 0 6px
}

.auth-head p {
  margin: 0 0 14px
}

/* ===== Form ===== */
.auth-form {
  display: grid;
  gap: 14px
}

/* Field */
.field {
  display: grid;
  gap: 8px;
  position: relative
}

/* Label */
.label {
  font-weight: 700;
  color: var(--text);
  letter-spacing: .2px;
}

/* Input base */
.input {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #fff;
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease,
    transform .06s ease;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0);
}

/* Hover = subtle lift + border tint */
.input:hover {
  border-color: color-mix(in srgb, var(--border) 60%, var(--accent) 40%);
  background: linear-gradient(180deg, #fff, #fafcff);
}

/* Focus = premium ring + gradient edge (content-box mask to keep ring on outside) */
.input:focus {
  outline: none;
  border-color: transparent;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, .18),
    inset 0 0 0 1px #cfe0ff;
}

/* Valid / Invalid hints (optional native states) */
.input:user-valid {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18), inset 0 0 0 1px #c8f2da
}

.input:user-invalid:focus {
  box-shadow: 0 0 0 3px rgba(244, 63, 94, .18), inset 0 0 0 1px #ffd0d5
}

/* Password wrapper */
.pw {
  position: relative
}

.pw .pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease, background .2s ease;
}

.pw .pw-toggle:hover {
  border-color: #cfe0ff;
  background: #f7fbff;
  transform: translateY(-50%) scale(1.03);
}

.pw .pw-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Remember / forgot row */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer
}

.chk input {
  accent-color: var(--accent)
}

/* Submit button */
.auth-btn {
  margin-top: 6px;
  width: 100%;
  position: relative;
  isolation: isolate;
}

.auth-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  z-index: -1;
  background: radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, .25), transparent);
  opacity: 0;
  transition: opacity .25s ease;
}

.auth-btn:hover::after {
  opacity: 1
}

/* Providers */
.auth-alt {
  display: grid;
  gap: 10px;
  margin-top: 10px
}

.auth-provider {
  width: 100%;
  position: relative;
  border-color: var(--border);
  background: #fff;
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-provider:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--border) 50%, var(--accent) 50%);
  background: linear-gradient(180deg, #fff, #f9fbff);
  box-shadow: 0 10px 22px rgba(16, 24, 40, .08);
}

/* Error */
.auth-error {
  margin-top: 8px;
  color: #b42318;
  background: #fff5f5;
  border: 1px solid #ffdad6;
  border-radius: 12px;
  padding: 9px 12px;
  display: none;
}

/* Small */
.small {
  font-size: .92rem
}

/* ===== Micro-interactions ===== */
.auth-form .input:active {
  transform: translateY(0.5px)
}

.auth-form a:hover {
  text-decoration: underline
}

/* ===== Mobile tweaks ===== */
@media (max-width:520px) {
  .auth-card {
    border-radius: 16px
  }

  .auth-alt {
    gap: 8px
  }
}
