/* Veblyx Login — brand-first, mobile responsive */

@font-face {
  font-family: "Cal Sans";
  src: url("../fonts/cal-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bodyFont: "Golos Text", sans-serif;
  --titleFont: "Cal Sans", "Golos Text", sans-serif;
  --primary: #d97706;
  --primary-rgb: 217, 119, 6;
  --primary-hover: #b45309;
  --ink: #1e293b;
  --ink-soft: #334155;
  --muted: #64748b;
  --danger: #e11d48;
  --line: rgba(30, 41, 59, 0.1);
  --surface: #ffffff;
  --shade: #fff9ee;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--bodyFont);
  color: var(--ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

/* ── Hero (full-bleed visual) ─────────────────────────────── */

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 56px);
  overflow: hidden;
  color: #fff;
  isolation: isolate;
}

.login-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.82) 55%, rgba(15, 23, 42, 0.92) 100%),
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(var(--primary-rgb), 0.55), transparent 55%),
    radial-gradient(ellipse 50% 45% at 15% 85%, rgba(var(--primary-rgb), 0.22), transparent 50%),
    linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
}

.login-hero-bg::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.02) 18px 19px
    );
  opacity: 0.7;
  animation: heroDrift 28s linear infinite;
}

.login-hero-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.login-hero-inner {
  position: relative;
  max-width: 28rem;
  margin-top: auto;
  margin-bottom: auto;
  animation: riseIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-hero-brand {
  margin: 0 0 18px;
  font-family: var(--titleFont);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: #fff;
}

.login-hero-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 0 18px;
  border-radius: 16px;
  object-fit: contain;
  background: #0a0a0a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.login-hero-line {
  margin: 0 0 14px;
  font-family: var(--titleFont);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.88);
}

.login-hero-copy {
  margin: 0;
  max-width: 32ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.58);
}

.login-hero-foot {
  position: relative;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.35);
  animation: fadeIn 0.8s ease 0.25s both;
}

/* ── Form panel ───────────────────────────────────────────── */

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(var(--primary-rgb), 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(30, 41, 59, 0.05), transparent 50%),
    var(--shade);
}

.login-panel {
  width: 100%;
  max-width: 380px;
  animation: riseIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.login-panel-head {
  margin-bottom: 28px;
}

.login-panel-brand {
  display: none;
  margin: 0 0 10px;
  font-family: var(--titleFont);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.login-panel-logo {
  display: none;
  width: 40px;
  height: 40px;
  margin: 0 0 14px;
  border-radius: 10px;
  object-fit: contain;
  background: #0a0a0a;
}

.login-panel-head h2 {
  margin: 0 0 8px;
  font-family: var(--titleFont);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.login-panel-sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.form-group input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--bodyFont);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.form-group input:focus {
  border-color: rgba(var(--primary-rgb), 0.65);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--bodyFont);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--ink);
  background: rgba(30, 41, 59, 0.05);
}

.login-btn {
  width: 100%;
  margin-top: 4px;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--bodyFont);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.22);
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.login-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.28);
}

.login-btn:active {
  transform: translateY(1px) scale(0.99);
}

.login-btn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(225, 29, 72, 0.08);
  color: var(--danger);
  font-size: 0.85rem;
  line-height: 1.4;
}

.login-footer {
  margin: 24px 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Motion ───────────────────────────────────────────────── */

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, 24px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .login-hero-inner,
  .login-panel,
  .login-hero-foot,
  .login-hero-bg::after {
    animation: none !important;
  }
}

/* ── Mobile ───────────────────────────────────────────────── */

@media (max-width: 860px) {
  .login-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .login-hero {
    min-height: 38vh;
    min-height: 38dvh;
    padding: 28px 22px 32px;
    justify-content: flex-end;
  }

  .login-hero-inner {
    margin: 0;
  }

  .login-hero-brand {
    font-size: clamp(2.6rem, 12vw, 3.4rem);
    margin-bottom: 10px;
  }

  .login-hero-line {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .login-hero-copy {
    font-size: 0.92rem;
    max-width: 36ch;
  }

  .login-hero-foot {
    display: none;
  }

  .login-main {
    align-items: flex-start;
    padding: 28px 20px 40px;
    border-radius: 20px 20px 0 0;
    margin-top: -16px;
    position: relative;
    z-index: 1;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  }

  .login-panel-brand {
    display: none;
  }

  .login-panel-logo {
    display: block;
  }
}

@media (max-width: 420px) {
  .login-hero {
    min-height: 34vh;
    padding: 24px 18px 28px;
  }

  .login-main {
    padding: 24px 16px 36px;
  }

  .login-panel-head h2 {
    font-size: 1.5rem;
  }
}
