@import url("/css/tokens.css");

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

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

body {
  margin: 0;
  background: #F2EEE5;
  color: var(--sphere-text);
  font-family: var(--sphere-font-sans);
}

.sphere-auth {
  width: min(1180px, calc(100vw - 40px));
  min-height: min(760px, calc(100vh - 40px));
  margin: 20px auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  border: 1px solid var(--sphere-border);
  border-radius: var(--sphere-radius-lg);
  background: var(--sphere-bg);
  box-shadow: var(--sphere-shadow-md);
}

.sphere-auth__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 42px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 26%, rgba(183, 101, 42, 0.14), transparent 28%),
    linear-gradient(145deg, #F8F2E8 0%, #E4D7C3 58%, #C8B293 100%);
}

.sphere-auth__brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -145px;
  bottom: -170px;
  border: 1px solid rgba(43, 43, 43, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,0.08), 0 0 0 110px rgba(255,255,255,0.05);
}

.sphere-auth__wordmark {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.sphere-auth__mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #F3EFE5 5%, #A69A84 48%, #1B1916 51%, #D5C9B5 100%);
}

.sphere-auth__statement {
  position: relative;
  z-index: 2;
  max-width: 470px;
}

.sphere-auth__eyebrow {
  margin: 0 0 14px;
  color: var(--sphere-accent);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.sphere-auth__statement h1 {
  margin: 0;
  font-family: var(--sphere-font-serif);
  font-size: clamp(3rem, 5vw, 5.4rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.sphere-auth__statement > p:last-child {
  max-width: 40ch;
  margin: 24px 0 0;
  color: var(--sphere-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.sphere-auth__signature {
  position: relative;
  z-index: 2;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.25em;
}

.sphere-auth__form-wrap {
  display: grid;
  place-items: center;
  padding: 42px;
  background: var(--sphere-surface);
}

.sphere-auth__form-card {
  width: min(390px, 100%);
}

.sphere-auth__form-card h2 {
  margin: 0;
  font-family: var(--sphere-font-serif);
  font-size: 2.55rem;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.sphere-auth__subcopy {
  margin: 10px 0 28px;
  color: var(--sphere-text-muted);
  font-size: 0.84rem;
}

.sphere-auth__notice,
.sphere-auth__error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--sphere-radius-sm);
  font-size: 0.78rem;
}

.sphere-auth__notice {
  border: 1px solid rgba(79, 122, 85, 0.26);
  background: rgba(79, 122, 85, 0.11);
  color: #3F6746;
}

.sphere-auth__error {
  border: 1px solid var(--sphere-accent-border);
  background: var(--sphere-accent-soft);
  color: #6F3A18;
}

.sphere-auth__form {
  display: grid;
  gap: 18px;
}

.sphere-auth__form label {
  display: grid;
  gap: 8px;
  color: var(--sphere-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

.sphere-auth__form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--sphere-border-strong);
  border-radius: var(--sphere-radius-sm);
  outline: 0;
  background: var(--sphere-card);
  color: var(--sphere-text);
}

.sphere-auth__form input:focus {
  border-color: var(--sphere-accent-border);
  box-shadow: 0 0 0 3px var(--sphere-accent-soft);
}

.sphere-auth__form button {
  height: 44px;
  margin-top: 4px;
  border: 1px solid var(--sphere-cta-border);
  border-radius: var(--sphere-radius-sm);
  background: var(--sphere-cta-bg);
  color: var(--sphere-cta-text);
  font-weight: 700;
  cursor: pointer;
}

.sphere-auth__form button:hover,
.sphere-auth__form button:focus-visible {
  background: var(--sphere-cta-hover);
  outline: none;
}

.sphere-auth__privacy {
  margin: 24px 0 0;
  color: var(--sphere-text-muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

@media (max-width: 780px) {
  body { background: var(--sphere-bg); }

  .sphere-auth {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sphere-auth__brand {
    min-height: 260px;
    padding: 26px;
  }

  .sphere-auth__statement h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .sphere-auth__statement > p:last-child,
  .sphere-auth__signature { display: none; }

  .sphere-auth__form-wrap { padding: 36px 24px; }
}

.sphere-auth__resend-form{margin-top:12px}.sphere-auth__secondary-button{width:100%;height:40px;border:1px solid var(--sphere-border-strong);border-radius:var(--sphere-radius-sm);background:var(--sphere-surface-soft);color:var(--sphere-text-secondary);font-weight:700;cursor:pointer}.sphere-auth__secondary-button:hover,.sphere-auth__secondary-button:focus-visible{background:var(--sphere-active-bg);outline:none}.sphere-auth__secondary-button:disabled{opacity:.45;cursor:not-allowed}.sphere-auth__privacy a{color:var(--sphere-text-secondary)}

.sphere-auth__logo{width:58px;height:58px;object-fit:contain;display:block;flex:0 0 auto}

/* Authentication-code resend countdown */
.sphere-auth__resend-form{display:grid;gap:7px}.sphere-auth__resend-status{margin:0;color:var(--sphere-text-muted);font-size:.68rem;line-height:1.35}.sphere-auth__secondary-button:disabled{cursor:not-allowed;opacity:.48}
