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

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8f9fb;
  color: #1a1a2e;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Split Layout ─────────────────────────────────────────── */
.login-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ── Left: Brand Panel ────────────────────────────────────── */
.brand-panel {
  position: relative;
  width: 50%;
  min-width: 0;
  background: #0a0f1a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Blueprint SVG Grid */
.blueprint-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: gridReveal 1.2s ease-out 0.3s forwards;
}

@keyframes gridReveal {
  to { opacity: 1; }
}

.grid-line {
  stroke: #1a2744;
  stroke-width: 0.5;
  animation: linePulse 4s ease-in-out infinite;
}

.grid-line--major {
  stroke: #1e3a5f;
  stroke-width: 1;
  animation: linePulseMajor 5s ease-in-out infinite;
}

.grid-line:nth-child(odd) { animation-delay: 0s; }
.grid-line:nth-child(even) { animation-delay: 2s; }
.grid-line--major:nth-child(3n) { animation-delay: 1s; }
.grid-line--major:nth-child(3n+1) { animation-delay: 2.5s; }
.grid-line--major:nth-child(3n+2) { animation-delay: 0.5s; }

@keyframes linePulse {
  0%, 100% { stroke-opacity: 0.3; }
  50% { stroke-opacity: 0.7; }
}

@keyframes linePulseMajor {
  0%, 100% { stroke-opacity: 0.35; }
  50% { stroke-opacity: 0.85; }
}

/* Diagonal Orange Stripe */
.diagonal-stripe {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  animation: stripeReveal 0.8s ease-out 0.6s forwards;
}

@keyframes stripeReveal {
  to { opacity: 1; }
}

.diagonal-stripe::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 58%;
  width: 110px;
  height: 160%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    #f97316 8%,
    #fb923c 50%,
    #f97316 92%,
    transparent 100%
  );
  transform: rotate(-22deg);
  transform-origin: center center;
  opacity: 0.92;
}

.diagonal-stripe::after {
  content: '';
  position: absolute;
  top: -20%;
  left: calc(58% + 130px);
  width: 3px;
  height: 160%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(249, 115, 22, 0.4) 15%,
    rgba(249, 115, 22, 0.4) 85%,
    transparent 100%
  );
  transform: rotate(-22deg);
  transform-origin: center center;
}

/* Brand Content */
.brand-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 clamp(2.5rem, 5vw, 5rem);
  max-width: 480px;
  width: 100%;
}

/* WF Mark */
.wf-mark {
  font-family: 'Anybody', sans-serif;
  font-weight: 800;
  font-size: clamp(4.5rem, 7vw, 7rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateX(-40px);
  animation: slideInLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.wf-mark span {
  color: #2563eb;
}

/* Title */
.brand-title {
  font-family: 'Anybody', sans-serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e2e8f0;
  line-height: 1.2;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateX(-40px);
  animation: slideInLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

/* Tagline */
.brand-tagline {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: #94a3b8;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateX(-40px);
  animation: slideInLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

/* Accent bar under tagline */
.brand-accent {
  width: 48px;
  height: 3px;
  background: #f97316;
  margin-top: 1.5rem;
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: accentGrow 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

@keyframes accentGrow {
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Right: Form Panel ────────────────────────────────────── */
.form-panel {
  width: 50%;
  min-width: 0;
  background: #f8f9fb;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.form-container {
  width: 100%;
  max-width: 380px;
}

/* Form Header */
.form-header {
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.form-header h2 {
  font-family: 'Anybody', sans-serif;
  font-weight: 600;
  font-size: 1.75rem;
  color: #0a0f1a;
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}

.form-header p {
  font-size: 0.9375rem;
  color: #64748b;
  font-weight: 400;
}

/* Error Area */
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #991b1b;
  line-height: 1.5;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-error::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  vertical-align: -3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ef4444'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center / contain;
}

.login-error ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.login-error ul li + li {
  margin-top: 0.25rem;
}

/* Form Fields */
.field-group {
  margin-bottom: 1.375rem;
}

.field-group:nth-child(2) {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.field-group:nth-child(3) {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards;
}

.field-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.field-group input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 0.875rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group input::placeholder {
  color: #94a3b8;
}

.field-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-group input:hover:not(:focus) {
  border-color: #94a3b8;
}

/* Submit Button */
.btn-signin {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: #2563eb;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

.btn-signin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-signin:hover {
  background: #f97316;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
}

.btn-signin:hover::before {
  opacity: 1;
}

.btn-signin:active {
  transform: translateY(1px) !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn-signin:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Footer */
.form-footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #94a3b8;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.25s forwards;
}

.form-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.form-footer a:hover {
  color: #f97316;
}

.form-footer a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 2px;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Corner Dimension Marks (blueprint aesthetic) ─────────── */
.corner-marks {
  position: absolute;
  inset: 24px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: gridReveal 1.2s ease-out 1.4s forwards;
}

.corner-marks::before,
.corner-marks::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
}

.corner-marks::before {
  top: 0;
  left: 0;
  border-top: 1px solid #2563eb;
  border-left: 1px solid #2563eb;
  opacity: 0.4;
}

.corner-marks::after {
  bottom: 0;
  right: 0;
  border-bottom: 1px solid #2563eb;
  border-right: 1px solid #2563eb;
  opacity: 0.4;
}

/* ── Mobile: Responsive ───────────────────────────────────── */
@media (max-width: 840px) {
  .login-shell {
    flex-direction: column;
  }

  .brand-panel {
    width: 100%;
    height: 120px;
    min-height: 120px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }

  .blueprint-grid {
    opacity: 0.5;
  }

  .brand-content {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    max-width: 100%;
  }

  .wf-mark {
    font-size: 2.5rem;
    margin-bottom: 0;
  }

  .brand-title {
    font-size: 1rem;
    letter-spacing: 0.08em;
    margin-bottom: 0;
  }

  .brand-tagline,
  .brand-accent {
    display: none;
  }

  .diagonal-stripe::before {
    width: 60px;
    left: auto;
    right: -10%;
    top: -60%;
    height: 300%;
  }

  .diagonal-stripe::after {
    left: auto;
    right: calc(-10% - 80px);
    top: -60%;
    height: 300%;
  }

  .corner-marks {
    display: none;
  }

  .form-panel {
    width: 100%;
    flex: 1;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    overflow-y: auto;
  }

  .form-container {
    max-width: 400px;
  }

  .form-header {
    margin-bottom: 1.75rem;
  }
}

@media (max-width: 400px) {
  .form-panel {
    padding: 1.5rem 1.25rem;
  }

  .brand-content {
    padding: 0 1.25rem;
  }
}

/* -----------------------------------------------------------------------------
 * Blueprint crosshair group — translates the 4 short crosshair lines to the
 * centerpoint of the SVG. SVG attribute values do not support calc(); we use
 * simple integer offsets here and translate the parent group via CSS transform.
 * ----------------------------------------------------------------------------- */
.crosshair-group {
  transform: translate(50%, 50%);
  transform-origin: 0 0;
}
