:root {
  --ink: #14201c;
  --ink-soft: #3d4f47;
  --paper: #f3efe6;
  --panel: rgba(255, 252, 246, 0.92);
  --line: rgba(20, 32, 28, 0.12);
  --accent: #1f6b4f;
  --accent-deep: #0f3d2e;
  --warn: #8a4b1f;
  --shadow: 0 24px 60px rgba(15, 40, 30, 0.18);
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

.auth-scene {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 20% 20%, #2f8f6b 0%, transparent 55%),
    radial-gradient(900px 600px at 80% 80%, #c4a35a 0%, transparent 50%),
    linear-gradient(145deg, #0d2a22 0%, #1a4636 45%, #244038 100%);
  animation: wash 14s ease-in-out infinite alternate;
}

.visual-wash {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.12), transparent 40%);
  animation: drift 18s ease-in-out infinite;
}

.visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
  opacity: 0.45;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  background:
    linear-gradient(180deg, rgba(243,239,230,0.95), rgba(236,230,216,0.98)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M30 0v60M0 30h60' stroke='%2314201c' stroke-opacity='.04'/%3E%3C/svg%3E");
}

.brand-block { margin-bottom: 2rem; animation: rise 0.7s ease both; }
.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
}
.brand-tag {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.auth-card {
  max-width: 420px;
  padding: 1.5rem 0 0;
  animation: rise 0.85s ease both;
}

.screen-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}
.screen-lead {
  margin: 0.45rem 0 1.4rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 79, 0.18);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.btn-primary,
.btn-ghost,
.linkish {
  font: inherit;
  cursor: pointer;
}
.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #f7fff9;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.65; cursor: wait; transform: none; }

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  color: var(--ink);
}
.linkish {
  border: 0;
  background: none;
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.9rem;
  padding: 0;
}

.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.dev-token {
  margin-top: 1rem;
  padding: 0.85rem;
  background: #1a2a24;
  color: #d8f3e5;
  border-radius: 10px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.toast {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fff7ea;
  color: var(--warn);
  border: 1px solid rgba(138, 75, 31, 0.25);
  max-width: 420px;
}
.toast.ok {
  background: #e8f6ef;
  color: var(--accent-deep);
  border-color: rgba(31, 107, 79, 0.25);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4%, -3%, 0); }
}
@keyframes wash {
  from { filter: saturate(1); }
  to { filter: saturate(1.15) brightness(1.05); }
}

@media (max-width: 860px) {
  .auth-scene { grid-template-columns: 1fr; }
  .auth-visual { min-height: 28vh; }
}
