/**
 * Auth / login — NovaCRM
 * Layout centered, compact, professional.
 */
:root {
  --auth-ink: #0f172a;
  --auth-muted: #64748b;
  --auth-line: #e2e8f0;
  --auth-primary: #1e3a8a;
  --auth-primary-deep: #152a66;
  --auth-surface: #ffffff;
  --auth-field: #fff;
  --auth-bg: #f1f5f9;
}

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

html, body { height: 100%; }

body.auth-body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--auth-ink);
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(30, 58, 138, 0.08), transparent 55%),
    var(--auth-bg);
  -webkit-font-smoothing: antialiased;
}

.auth-wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 440px;
  margin: 0 auto;
  padding: 1.25rem 1.15rem 2rem;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--auth-ink);
  min-width: 0;
}

.auth-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--auth-primary);
  color: #fff;
  flex-shrink: 0;
}

.auth-logo-mark i { font-size: 1rem; }

.auth-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.auth-logo-text strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-logo-text span {
  font-size: 0.68rem;
  color: var(--auth-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-top-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-muted);
  text-decoration: none;
  white-space: nowrap;
}

.auth-top-link:hover { color: var(--auth-primary); }

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.3rem;
}

.auth-subtitle {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  margin-bottom: 1rem;
  border-radius: 9px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-alert i { flex-shrink: 0; margin-top: 0.1rem; }

.auth-alert--ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.auth-field { margin-bottom: 0.9rem; }

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: #334155;
  margin-bottom: 0.35rem;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.auth-input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--auth-line);
  background: var(--auth-field);
  border-radius: 9px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--auth-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.auth-input:hover { border-color: #cbd5e1; }

.auth-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.14);
}

.auth-input.is-invalid {
  border-color: #f87171;
  background: #fffafa;
}

.auth-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.auth-input-wrap--password .auth-input { padding-right: 2.6rem; }

.auth-toggle-pass {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--auth-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.auth-toggle-pass:hover {
  color: var(--auth-ink);
  background: rgba(15, 23, 42, 0.05);
}

.auth-submit {
  width: 100%;
  margin-top: 0.45rem;
  border: 0;
  border-radius: 9px;
  padding: 0.72rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  background: var(--auth-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover { background: var(--auth-primary-deep); }

.auth-submit.is-loading {
  pointer-events: none;
  opacity: 0.88;
}

.auth-submit .spinner {
  display: none;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
  vertical-align: -0.12em;
  margin-right: 0.35rem;
}

.auth-submit.is-loading .spinner { display: inline-block; }
.auth-submit.is-loading .label-idle { display: none; }

.auth-hint {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--auth-muted);
  line-height: 1.4;
}

.auth-hint--link { margin-top: 0.45rem; }
.auth-hint a {
  color: var(--auth-primary);
  font-weight: 650;
  text-decoration: none;
}
.auth-hint a:hover { text-decoration: underline; }

.auth-foot {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

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

@media (min-width: 480px) {
  .auth-wrap { padding-top: 2rem; }
  .auth-card { padding: 1.75rem 1.6rem 1.5rem; }
}
