:root {
  --wa-green: #00a884;
  --wa-green-dark: #008069;
  --wa-ink: #111b21;
  --wa-muted: #667781;
  --wa-line: #d1d7db;
  --wa-page: #e7f3ee;
  --wa-chat: #efeae2;
  --wa-panel: #ffffff;
  --wa-soft: #f0f2f5;
  --wa-danger: #d93025;
  --shadow: 0 24px 60px rgba(17, 27, 33, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wa-page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--wa-ink);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(0, 128, 105, 0.16) 0 220px, transparent 220px),
    linear-gradient(135deg, #dcefe7 0%, #f8faf8 56%, #eaf2ed 100%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  cursor: pointer;
}

#authContainer {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 28px;
  align-items: center;
}

.auth-hero {
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-badge {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--wa-green), var(--wa-green-dark));
  box-shadow: 0 14px 28px rgba(0, 128, 105, 0.28);
}

.brand-badge span {
  width: 27px;
  height: 21px;
  display: block;
  border-radius: 12px 12px 12px 4px;
  background: #ffffff;
}

.brand-badge::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  right: 16px;
  top: 18px;
  border-radius: 50%;
  background: var(--wa-green);
}

.brand {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin-top: 8px;
  color: #31524a;
  font-size: 1.03rem;
  line-height: 1.55;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.feature-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(0, 128, 105, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #31524a;
  font-weight: 650;
  font-size: 0.9rem;
}

.chat-preview {
  width: min(100%, 640px);
  overflow: hidden;
  border: 1px solid rgba(17, 27, 33, 0.1);
  border-radius: 8px;
  background: var(--wa-panel);
  box-shadow: var(--shadow);
}

.preview-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #202c33;
  color: #e9edef;
}

.preview-bar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe5e7;
}

.preview-bar strong,
.preview-bar small {
  display: block;
}

.preview-bar small {
  margin-top: 2px;
  color: #aebac1;
}

.preview-body {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background-color: var(--wa-chat);
  background-image:
    linear-gradient(45deg, rgba(17, 27, 33, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 27, 33, 0.035) 25%, transparent 25%);
  background-size: 28px 28px;
}

.bubble {
  width: fit-content;
  max-width: 78%;
  margin: 0;
  padding: 9px 11px;
  border-radius: 8px;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.12);
}

.bubble.incoming {
  background: #ffffff;
}

.bubble.outgoing {
  align-self: flex-end;
  background: #d9fdd3;
}

.auth-card {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(17, 27, 33, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-panel {
  min-height: 312px;
}

.auth-box {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.auth-box.active {
  display: flex;
  animation: fadeUp 0.22s ease both;
}

.auth-box h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.auth-intro {
  margin: -4px 0 4px;
  color: var(--wa-muted);
  line-height: 1.45;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--wa-line);
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  color: var(--wa-ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input::placeholder {
  color: #8696a0;
}

input:focus {
  border-color: var(--wa-green);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.16);
}

button[type="submit"],
button.secondary {
  width: 100%;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 750;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

button[type="submit"] {
  margin-top: 4px;
  background: var(--wa-green-dark);
  color: #ffffff;
}

button.secondary {
  background: var(--wa-soft);
  color: var(--wa-ink);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.auth-message {
  min-height: 1.25em;
  margin: 0;
  color: var(--wa-muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.auth-message.success {
  color: var(--wa-green-dark);
}

.auth-message.error {
  color: var(--wa-danger);
}

#footer {
  padding: 0 16px 18px;
  text-align: center;
  color: #5c6f69;
  font-size: 0.9rem;
}

#footer p {
  margin: 0;
}

#footer a {
  color: var(--wa-green-dark);
  text-decoration: none;
  margin: 0 5px;
  font-weight: 650;
}

#footer a:hover {
  text-decoration: underline;
}

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

@media (max-width: 860px) {
  body {
    background:
      linear-gradient(180deg, rgba(0, 128, 105, 0.2) 0 170px, transparent 170px),
      linear-gradient(135deg, #e2f1eb 0%, #fafafa 100%);
  }

  #authContainer {
    min-height: auto;
    padding: 18px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-hero {
    display: grid;
    gap: 14px;
  }

  .brand-row {
    margin-bottom: 0;
  }

  .feature-pills {
    margin-bottom: 0;
  }

  .chat-preview {
    display: none;
  }
}

@media (max-width: 480px) {
  #authContainer {
    padding: 12px;
  }

  .brand-badge {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .auth-card {
    padding: 20px;
  }

  .feature-pills span {
    flex: 1 1 auto;
    justify-content: center;
  }
}
