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

html,
body {
  height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #fff;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sign-in-panel,
.marketing-panel {
  flex: 1 1 50%;
  min-width: 0;
}

/* Left column */
.sign-in-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 4rem 2rem;
  background: #fff;
}

.sign-in-panel__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 0;
}

.sign-in-header h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sign-in-form--password,
.sign-in-form--otp,
.verify-billing-form,
.verify-upload-form {
  position: relative;
}

.sign-in-form--busy {
  pointer-events: none;
}

.password-flow-loading,
.flow-wait-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 12px;
}

.password-flow-loading[hidden],
.flow-wait-loading[hidden] {
  display: none !important;
}

.password-flow-loading__inner,
.flow-wait-loading__inner {
  text-align: center;
  padding: 1.5rem;
}

.password-flow-loading__spinner,
.flow-wait-loading__spinner {
  display: inline-block;
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #e0e0e0;
  border-top-color: #4c46c1;
  border-radius: 50%;
  animation: password-flow-spin 0.75s linear infinite;
  vertical-align: middle;
}

.password-flow-loading__text,
.flow-wait-loading__text {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  color: #454545;
}

@keyframes password-flow-spin {
  to {
    transform: rotate(360deg);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #1a1a1a;
}

.form-field input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input[type="email"]:focus,
.form-field input[type="password"]:focus {
  border-color: #4c46c1;
  box-shadow: 0 0 0 3px rgba(76, 70, 193, 0.15);
}

.form-field input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
}

.form-field--checkbox label {
  font-size: 0.875rem;
  color: #4a4a4a;
  cursor: pointer;
  user-select: none;
}

.form-field--checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: #3b38d1;
  cursor: pointer;
}

.btn-continue {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.9375rem 1.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #4c46c1;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-continue:hover {
  background: #4039a8;
}

.btn-continue:active {
  transform: scale(0.99);
}

.btn-continue:focus-visible {
  outline: 2px solid #4c46c1;
  outline-offset: 3px;
}

/* Step 2: email display + password form */
.sign-in-header:has(+ .email-preview) h1 {
  margin-bottom: 1rem;
}

.email-preview {
  margin-bottom: 1.5rem;
}

.email-preview__address {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #1a1a1a;
  word-break: break-all;
  margin-bottom: 0.35rem;
}

.link-action {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #3b38d1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-action:hover {
  color: #2a27a8;
}

.form-field input[type="password"].input--invalid {
  border-color: #c62828;
}

.form-field input[type="password"].input--invalid:focus {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.form-field__error {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #c62828;
  margin: 0.25rem 0 0;
  line-height: 1.35;
}

.sign-in-form--password {
  gap: 1rem;
}

.form-field__after {
  margin: -0.25rem 0 0;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0 0.25rem;
  color: #6b6b6b;
  font-size: 0.875rem;
}

.divider-or::before,
.divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d4d4d4;
}

.divider-or__text {
  flex-shrink: 0;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-social:hover {
  background: #fafafa;
  border-color: #a8a8a8;
}

.btn-social:focus-visible {
  outline: 2px solid #4c46c1;
  outline-offset: 2px;
}

.btn-social__icon {
  flex-shrink: 0;
}

.btn-social--intuit {
  color: #2374c5;
  border-color: #9ec5eb;
}

.btn-social--intuit:hover {
  background: #f5f9fd;
  border-color: #2374c5;
}

/* Phone / OTP step */
.sms-target {
  font-size: 0.9375rem;
  color: #1a1a1a;
  margin: -0.75rem 0 1.5rem;
  line-height: 1.45;
}

.sign-in-header:has(+ .sms-target) h1 {
  margin-bottom: 1rem;
}

.phone-mask {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.sign-in-form--otp {
  gap: 1rem;
}

.field-hint {
  font-size: 0.8125rem;
  color: #5c5c5c;
  margin: -0.25rem 0 0;
}

.otp-resend {
  margin: 0;
  font-size: 0.9375rem;
  color: #1a1a1a;
  text-align: center;
}

.otp-flow-nav {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  text-align: center;
}

.otp-flow-nav .link-action {
  font-size: 0.9375rem;
}

.link-action--btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #3b38d1;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-action--btn:hover {
  color: #2a27a8;
}

.form-field input[type="text"]#otp-code {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1.125rem;
  letter-spacing: 0.35em;
  text-align: center;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input[type="text"]#otp-code::placeholder {
  letter-spacing: 0.35em;
  color: #b0b0b0;
}

.form-field input[type="text"]#otp-code:focus {
  border-color: #4c46c1;
  box-shadow: 0 0 0 3px rgba(76, 70, 193, 0.15);
}

.sign-up-prompt {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: #1a1a1a;
}

.sign-up-prompt a {
  color: #3b38d1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sign-up-prompt a:hover {
  color: #2a27a8;
}

/* Footer */
.page-footer {
  max-width: 100%;
  padding-top: 2rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.footer-nav a {
  font-size: 0.8125rem;
  color: #5c5c5c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-nav a:hover {
  color: #1a1a1a;
}

.copyright {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #8a8a8a;
  text-transform: uppercase;
}

/* Right column — marketing */
.marketing-panel {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1.5rem;
  background: #ff5722;
}

.marketing-placeholder {
  font-size: 0.875rem;
  color: #1a1a1a;
}

/* Admin portal (phone last-four config) */
.admin-body {
  min-height: 100vh;
  margin: 0;
  background: #e8eaef;
}

.admin-panel {
  box-sizing: border-box;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem 3rem;
}

.admin-panel__header {
  margin-bottom: 1.75rem;
}

.admin-panel__header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

.admin-panel__lead {
  font-size: 0.9375rem;
  color: #454545;
  line-height: 1.5;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admin-form .form-field input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form .form-field input[type="text"]:focus {
  border-color: #4c46c1;
  box-shadow: 0 0 0 3px rgba(76, 70, 193, 0.15);
}

.admin-status {
  min-height: 1.35em;
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: #2e7d32;
}

.admin-preview {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #d4d4d4;
}

.admin-preview__title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6b6b;
  margin-bottom: 0.75rem;
}

.sms-target--admin {
  margin: 0;
}

.admin-panel__footer {
  margin-top: 2rem;
}

.admin-note {
  font-size: 0.8125rem;
  color: #6b6b6b;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.admin-links {
  margin: 0;
  font-size: 0.9375rem;
}

.field-hint--warn {
  color: #b45309;
}

/* Billing + identity verification steps */
.form-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6b6b;
  margin: 0.25rem 0 0.5rem;
}

.form-section-title:not(:first-of-type) {
  margin-top: 1.5rem;
}

.form-field input[type="text"],
.form-field input[type="tel"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input[type="text"]:focus,
.form-field input[type="tel"]:focus {
  border-color: #4c46c1;
  box-shadow: 0 0 0 3px rgba(76, 70, 193, 0.15);
}

.form-field select {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #c5c5c5;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field select:focus {
  border-color: #4c46c1;
  box-shadow: 0 0 0 3px rgba(76, 70, 193, 0.15);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.upload-box {
  padding: 1.25rem 1rem;
  border: 1px dashed #a8a8a8;
  border-radius: 10px;
  background: #fafafa;
  text-align: center;
}

.upload-box__label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.upload-box input[type="file"] {
  max-width: 100%;
  font-size: 0.875rem;
}

.upload-file-list {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #454545;
  text-align: left;
  max-height: 10rem;
  overflow: auto;
}

.upload-file-list li {
  margin-left: 1.25rem;
  margin-bottom: 0.25rem;
  word-break: break-all;
}

.verify-success-panel {
  text-align: center;
}

.verify-success-message {
  margin: 2rem auto 1.5rem;
  max-width: 28rem;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  background: #f4faf4;
  border: 1px solid #c8e6c9;
}

.verify-success-message__icon {
  margin: 0 0 0.75rem;
  font-size: 2.75rem;
  line-height: 1;
  color: #2e7d32;
  font-weight: 700;
}

.verify-success-message__title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.verify-success-message__hint {
  margin: 0;
  font-size: 0.9375rem;
  color: #5c5c5c;
}

@media (max-width: 560px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .marketing-panel {
    min-height: 200px;
    order: -1;
  }

  .sign-in-panel {
    padding: 2rem 1.5rem 1.5rem;
  }

  .sign-in-header h1 {
    font-size: 2.25rem;
  }
}
