@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  background: #f5f6fa;
}

/* Split layout */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .login { grid-template-columns: 1fr 1fr; }
}

/* Left branding */
.login__brand {
  display: none;
  padding: 60px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #ec4899 120%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
@media (min-width: 900px) {
  .login__brand { display: flex; flex-direction: column; justify-content: space-between; }
}
.login__brand::before,
.login__brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.login__brand::before { width: 500px; height: 500px; top: -200px; right: -180px; }
.login__brand::after  { width: 400px; height: 400px; bottom: -160px; left: -120px; }

.login__brand-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }

.login__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
}
.login__logo-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.login__hero { margin: auto 0; max-width: 460px; }
.login__hero h2 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 18px;
}
.login__hero p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255,255,255,.82);
}

.login__features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}
.login__feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,.9);
}
.login__feature-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login__feature-icon svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

.login__foot {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  position: relative;
  z-index: 1;
}

/* Right form */
.login__form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.login__form {
  width: 100%;
  max-width: 400px;
}
.login__form-header { margin-bottom: 32px; }
.login__form-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.login__form-header p {
  font-size: 14px;
  color: #64748b;
}

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}
.input-wrap { position: relative; }
.input-wrap__icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.input-wrap__icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.form-input {
  width: 100%;
  padding: 12px 44px 12px 42px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  color: #0f172a;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.toggle-pass {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  transition: all .18s;
}
.toggle-pass:hover { background: #f1f5f9; color: #475569; }
.toggle-pass svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.login-error {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
  animation: shake .4s;
}
.login-error.is-visible { display: flex; }
.login-error svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-submit {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(99,102,241,.45);
}
.login-submit:disabled { opacity: .7; cursor: not-allowed; }
.login-submit svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

.spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-help {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.6;
}
.login-help code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .login__form-wrap { padding: 32px 20px; align-items: flex-start; }
  .login__form { max-width: 100%; padding-top: 20px; }
  .login__form-header h1 { font-size: 22px; }
}