/* ==========================================================================
   Libra CRM — Sign-in screen
   ========================================================================== */
:root {
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --text:   #1e2432;
  --text-2: #5a6274;
  --text-3: #8a91a4;
  --border: #e6e8ef;
  --danger: #ef4444;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #0b1020;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

@media (min-width: 900px) {
  body { grid-template-columns: 1fr 480px; grid-template-rows: 1fr; }
}

/* --- Brand panel -------------------------------------------------------
   Holds the logo and nothing else. The logo artwork is white-on-transparent,
   so it only ever sits on this dark surface — on narrow screens the panel
   becomes a slim bar above the form rather than disappearing. */
.brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 15% 10%,  rgba(139, 92, 246, .42), transparent 60%),
    radial-gradient(800px 700px at 85% 85%,  rgba(34, 211, 238, .30), transparent 60%),
    radial-gradient(700px 500px at 60% 40%,  rgba(244, 114, 182, .22), transparent 60%),
    linear-gradient(160deg, #0b1020 0%, #131c31 100%);
}
@media (min-width: 900px) { .brand-panel { padding: 56px; } }

/* Subtle grid overlay */
.brand-panel::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 35%, transparent 78%);
  pointer-events: none;
}

.brand-panel > * { position: relative; z-index: 1; }

.bp-logo {
  display: block;
  width: auto; max-width: 78%;
  height: 54px;
  object-fit: contain;
}
@media (min-width: 900px) { .bp-logo { height: 104px; max-width: 62%; } }

/* --- Right: form ------------------------------------------------------- */
.form-panel {
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}
.form-card { width: 100%; max-width: 360px; }

.form-card h2 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin: 0 0 6px; }
.form-card .sub { color: var(--text-3); font-size: 13.5px; margin: 0 0 26px; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.field .wrap { position: relative; }
.field .wrap svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.field input {
  width: 100%; height: 44px;
  padding: 0 13px 0 39px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.field input::placeholder { color: #b3b9c7; }
.field input:focus {
  outline: none; background: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
}

.toggle-pw {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.toggle-pw:hover { background: #f1f3f7; color: var(--text-2); }
.toggle-pw svg { position: static; transform: none; }

.btn-submit {
  width: 100%; height: 44px; margin-top: 8px;
  border: 0; border-radius: 11px;
  background: var(--brand-600); color: #fff;
  font-family: inherit; font-size: 14.5px; font-weight: 650;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7);
  transition: background .15s var(--ease), transform .06s var(--ease), box-shadow .15s var(--ease);
}
.btn-submit:hover { background: var(--brand-700); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, .3); }

.alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px; margin-bottom: 18px;
  border-radius: 10px;
  font-size: 13px; line-height: 1.45;
}
.alert svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.form-foot {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.6;
}
.form-foot a { color: var(--text-2); font-weight: 600; text-decoration: none; }
.form-foot a:hover { color: var(--brand-600); }

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