:root {
  --white: #f7f5f1;
  --white-pure: #ffffff;
  --charcoal: #1c1b19;
  --black: #0e0e0d;
  --concrete: #8c857a;
  --stone: #c5bdb0;
  --mist: #e8e3da;
  --brass: #f5c400;
  --brass-soft: #ffd84a;
  --brass-ink: #2a2a2a;
  --danger: #8b2e2e;
  --line: rgba(28, 27, 25, 0.12);
  --shadow: 0 18px 50px rgba(14, 14, 13, 0.12);
  --shadow-lift: 0 28px 60px rgba(14, 14, 13, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-accent: "Instrument Serif", Georgia, serif;
  --font-body: "Manrope", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--charcoal);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(245, 196, 0, 0.07), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(140, 133, 122, 0.12), transparent 50%),
    linear-gradient(180deg, var(--white) 0%, #f3f0ea 45%, var(--white) 100%);
}

a {
  color: var(--charcoal);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

button,
input {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.icon,
.btn__icon,
.field__icon,
.leads__status-icon,
.empty-state__icon,
.th-label svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon svg,
.btn__icon svg,
.field__icon svg,
.leads__status-icon svg,
.empty-state__icon svg,
.th-label svg {
  width: 1.05em;
  height: 1.05em;
}

.eyebrow {
  margin: 0 0 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--concrete);
}

.eyebrow .icon {
  color: var(--brass-ink);
  background: var(--brass);
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
}

.eyebrow .icon svg {
  width: 0.78rem;
  height: 0.78rem;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s var(--ease) forwards;
  animation-delay: calc(var(--delay, 0) * 80ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .leads-table tbody tr {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  * {
    transition: none !important;
  }
}

/* ——— Login ——— */

.page--login {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.login-shell {
  width: min(100%, 940px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 860px) {
  .login-shell {
    grid-template-columns: 1.05fr 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255, 253, 249, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(14, 14, 13, 0.88), rgba(28, 27, 25, 0.82)),
    linear-gradient(45deg, var(--black), #2a2a2a);
  color: var(--white);
  position: relative;
  overflow: hidden;
  min-height: 220px;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -15% -35% 25%;
  height: 70%;
  background: radial-gradient(circle, rgba(245, 196, 0, 0.32), transparent 65%);
  pointer-events: none;
}

@media (min-width: 860px) {
  .login-brand {
    border: none;
    border-radius: 0;
    min-height: 460px;
    padding: 2.5rem 2.25rem;
  }
}

.login-brand__logo {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
}

.login-brand__line {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-accent);
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1.05;
}

.login-brand__sub {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 28ch;
  color: rgba(247, 245, 241, 0.72);
  font-size: 0.95rem;
}

.login {
  width: min(100%, 420px);
  margin-inline: auto;
  padding: 2rem 1.5rem;
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

@media (min-width: 860px) {
  .login {
    width: auto;
    margin: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.75rem 2.5rem;
  }
}

.login__mark {
  width: 44px;
  height: 44px;
  margin-bottom: 1.15rem;
}

.login__mark img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
}

.login__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-accent);
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.login__lead {
  margin: 0 0 1.75rem;
  color: var(--concrete);
  max-width: 30ch;
}

.login__form {
  display: grid;
  gap: 1.05rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--concrete);
}

.field__control {
  position: relative;
  display: grid;
}

.field__icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--concrete);
  pointer-events: none;
  transition: color 0.25s var(--ease);
}

.field__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.9rem 1rem 0.9rem 2.7rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.field input:hover {
  border-color: rgba(28, 27, 25, 0.22);
}

.field input:focus {
  outline: none;
  border-color: var(--brass);
  background: var(--white-pure);
  box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.18);
}

.field__control:focus-within .field__icon {
  color: var(--brass-ink);
}

.field__error,
.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
}

.form-error {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(139, 46, 46, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(139, 46, 46, 0.06);
  animation: rise 0.35s var(--ease);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.15rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    background 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.btn__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.btn--primary {
  background: var(--brass);
  color: var(--brass-ink);
  box-shadow: 0 10px 24px rgba(245, 196, 0, 0.25);
}

.btn--primary:hover {
  background: var(--brass-soft);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(245, 196, 0, 0.3);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--wide {
  width: 100%;
  min-height: 3.2rem;
  margin-top: 0.25rem;
}

.btn--ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: rgba(28, 27, 25, 0.28);
  background: rgba(255, 255, 255, 0.55);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ——— Leads ——— */

.page--leads {
  padding-bottom: 3rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 241, 0.86);
  backdrop-filter: blur(14px);
  animation: rise 0.55s var(--ease);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar__brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.topbar__title {
  font-family: var(--font-accent);
  font-size: 1.45rem;
  line-height: 1;
}

.btn--icon {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 999px;
}

.leads {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.75rem auto 0;
}

.leads__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.leads__heading {
  margin: 0;
  font-family: var(--font-accent);
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 400;
  line-height: 1.1;
}

.leads__status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--concrete);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.leads__status-icon {
  color: var(--brass-ink);
  background: var(--brass);
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
}

.leads__status-icon svg {
  width: 0.75rem;
  height: 0.75rem;
}

.leads__status.is-loading {
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.55) 30%,
    rgba(245, 196, 0, 0.18) 45%,
    rgba(255, 255, 255, 0.55) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.leads__status.is-loading .leads__status-text {
  color: transparent;
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed rgba(28, 27, 25, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.65);
}

.empty-state__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-sm);
  background: var(--brass);
  color: var(--brass-ink);
}

.empty-state__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.empty-state__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-accent);
  font-size: 1.8rem;
}

.empty-state__text {
  margin: 0;
  color: var(--concrete);
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.leads-table th,
.leads-table td {
  text-align: left;
  vertical-align: top;
  padding: 1rem 1.05rem;
  border-bottom: 1px solid var(--line);
}

.leads-table th {
  background: rgba(232, 227, 218, 0.55);
  color: var(--concrete);
}

.th-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.th-label svg {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.8;
}

.leads-table tbody tr {
  opacity: 0;
  animation: rowIn 0.45s var(--ease) forwards;
  animation-delay: calc(var(--row-delay, 0) * 45ms);
  transition: background 0.25s var(--ease);
}

.leads-table tbody tr:hover {
  background: rgba(245, 196, 0, 0.06);
}

.leads-table tbody tr:last-child td {
  border-bottom: none;
}

.leads-table td.date {
  white-space: nowrap;
  color: var(--concrete);
  font-size: 0.88rem;
}

.leads-table td.name {
  font-weight: 600;
}

.leads-table td.message {
  max-width: 28rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(28, 27, 25, 0.86);
}

.leads-table a {
  color: var(--charcoal);
  text-decoration: underline;
  text-decoration-color: rgba(245, 196, 0, 0.7);
  text-underline-offset: 0.18em;
}

.leads-table a:hover {
  color: var(--black);
  text-decoration-color: var(--brass);
}

/* ——— Modal ——— */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 13, 0.48);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s var(--ease);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  padding: 1.75rem 1.5rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.97);
  box-shadow: var(--shadow-lift);
  text-align: center;
  animation: modalIn 0.3s var(--ease);
}

.modal__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brass);
  color: var(--brass-ink);
}

.modal__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.modal__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-accent);
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1.1;
}

.modal__text {
  margin: 0 0 1.5rem;
  color: var(--concrete);
  font-size: 0.98rem;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal__actions .btn {
  min-height: 2.85rem;
}

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

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal__backdrop,
  .modal__dialog {
    animation: none !important;
  }
}

@media (max-width: 720px) {
  .leads__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .leads-table th:nth-child(3),
  .leads-table td:nth-child(3) {
    display: none;
  }
}
