@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap");

:root {
  --bg-0: #f3f5f8;
  --bg-1: #e6ecf3;
  --ink-0: #0f172a;
  --ink-1: #334155;
  --ink-2: #64748b;
  --surface: #ffffff;
  --surface-line: #dbe3ee;
  --brand-0: #0f213d;
  --brand-1: #132b4f;
  --brand-accent: #febf30;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ok: #15803d;
  --focus: #0d9488;
  --shadow-sm: 0 16px 36px rgba(15, 23, 42, 0.1);
}

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

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

body {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.95), transparent 44%),
    radial-gradient(circle at 84% 12%, rgba(13, 148, 136, 0.12), transparent 36%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  color: var(--ink-0);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.display-container {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  box-shadow: var(--shadow-sm);
  animation: signup-fade 240ms ease-out;
}

.company-logo {
  margin-bottom: 0.55rem;
  text-align: center;
}

.company-logo .logo {
  width: 108px;
  height: auto;
}

.step {
  text-align: left;
}

#step-2:not(.hidden) {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.free-account h1 {
  margin: 0;
  text-align: center;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 1.62rem;
  letter-spacing: -0.01em;
  color: var(--ink-0);
}

.free-account .subtitle {
  margin: 0.42rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.divider {
  margin: 1rem 0 0.95rem;
}

.divider hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.signup-div {
  margin: 0;
}

.signup-form {
  display: grid;
  gap: 0.5rem;
}

label {
  margin-top: 0.35rem;
  color: var(--ink-1);
  font-size: 0.83rem;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  min-height: 2.65rem;
  border-radius: 0.66rem;
  border: 1px solid #cbd5e1;
  background: #fcfdff;
  padding: 0.62rem 0.78rem;
  font-size: 0.92rem;
  line-height: 1.25;
  color: var(--ink-0);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1.1em + 1px), calc(100% - 13px) calc(1.1em + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

button {
  width: 100%;
  margin-top: 0.55rem;
  border: 0;
  border-radius: 0.72rem;
  background: linear-gradient(140deg, var(--brand-1), var(--brand-0));
  color: #f8fafc;
  min-height: 2.8rem;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 33, 61, 0.2);
  filter: saturate(1.06);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: 3px solid rgba(46, 170, 220, 0.4);
  outline-offset: 2px;
}

#send-code-btn {
  margin-top: 0.4rem;
}

.privacy {
  margin-top: 0.82rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.72rem;
  text-align: center;
}

.privacy-policy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.45;
}

.privacy a,
.signin-link,
.resend-code-link,
#edit-email-link {
  color: #0f766e;
  text-decoration: none;
  font-weight: 700;
}

.privacy a:hover,
.signin-link:hover,
.resend-code-link:hover,
#edit-email-link:hover {
  text-decoration: underline;
}

.existing-user {
  margin-top: 0.2rem;
}

.signin-link {
  font-size: 0.8rem;
}

.signin-link span {
  font-weight: 800;
}

.code-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.48rem;
  margin: 0 0 0.72rem;
}

.code-inputs input {
  min-height: 3rem;
  padding: 0;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
}

#password-criteria {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  text-align: left;
}

#password-criteria li {
  font-size: 0.82rem;
  margin-bottom: 0.22rem;
  color: var(--danger);
}

#password-criteria li.valid {
  color: var(--ok);
}

#password-criteria li.invalid {
  color: var(--danger);
}

.invalid-input {
  border-color: var(--danger) !important;
  background: #fffafa;
}

.invalid-input:focus {
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16);
}

.error {
  color: var(--danger);
  font-size: 0.8rem;
  min-height: 1rem;
  line-height: 1.2;
  margin-top: 0.12rem;
}

.hidden_error {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease-in-out;
}

.hidden_error.visible {
  visibility: visible;
  opacity: 1;
}

.disabled-button,
button:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.88;
  box-shadow: none;
  transform: none;
  filter: none;
}

.disabled-button:hover,
button:disabled:hover {
  background: #cbd5e1;
  color: #64748b;
  box-shadow: none;
  transform: none;
  filter: none;
}

.hidden {
  display: none;
}

.disabled-link {
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  opacity: 0.85;
  text-decoration: none !important;
}

@keyframes signup-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@media (max-width: 560px) {
  body {
    padding: 0.8rem;
  }

  .display-container {
    width: 100%;
    padding: 0.95rem;
    border-radius: 0.92rem;
  }

  .company-logo .logo {
    width: 96px;
  }

  .free-account h1 {
    font-size: 1.44rem;
  }

  .free-account .subtitle {
    font-size: 0.86rem;
  }

  #step-2:not(.hidden) {
    min-height: 320px;
  }

  .code-inputs {
    gap: 0.36rem;
  }

  .code-inputs input {
    min-height: 2.6rem;
    font-size: 1.08rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
