:root {
  --yellow: #f7cd0a;
  --gray-bg: #ffffff;
  --gray-soft: #dddddd;
  --text: #141414;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Sora', sans-serif;
  color: var(--text);
  background: #ffffff;
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(74px + env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--gray-bg);
  border-radius: 20px;
  min-height: calc(100vh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 92px 20px 24px;
}

.auth-card-register {
  min-height: auto;
  padding: 34px 20px 24px;
}

.brand-box {
  width: fit-content;
  margin: 0 auto 30px;
  line-height: 1;
}

.brand-logo {
  display: block;
  width: min(220px, 68vw);
  height: auto;
}

h1 {
  margin: 0 0 28px;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
}

.stack-sm {
  display: grid;
  gap: 9px;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.stack-register {
  max-width: 320px;
}

label {
  font-size: 0.78rem;
  font-weight: 500;
}

input:not([type='checkbox']),
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--gray-soft);
  padding: 10px 12px;
  font: inherit;
  color: #111;
}

input:not([type='checkbox']):focus,
select:focus {
  outline: 2px solid #f4d443;
  border-color: #dab300;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0 2px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.terms-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
  accent-color: #f7cd0a;
}

.terms-check-text {
  display: grid;
  gap: 3px;
}

.terms-check-text label {
  font-size: 0.78rem;
  margin: 0;
}

.terms-link-btn {
  width: fit-content;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: underline;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.terms-modal-card {
  width: min(760px, 100%);
  height: min(86vh, 760px);
  border-radius: 14px;
  background: #fff;
  border: 1px solid #d9d9d9;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.terms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #ececec;
  padding: 10px 12px;
}

.terms-modal-header h2 {
  margin: 0;
  font-size: 0.92rem;
}

.terms-close-btn {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #c7c7c7;
  background: #f3f3f3;
  color: #202020;
}

.terms-modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.terms-modal-footer {
  padding: 10px 12px;
  border-top: 1px solid #ececec;
}

.terms-accept-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 0;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
}

button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  min-height: 40px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#login-btn,
#forgot-submit-btn,
#register-btn,
.register-open-btn {
  background: var(--yellow);
  color: #151515;
}

.forgot-password-btn {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: #111;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
}

.back-btn {
  background: #cfcfcf;
  color: #202020;
}

.register-callout {
  width: 100%;
  max-width: 260px;
  margin: 24px auto 10px;
  font-size: 0.98rem;
  font-weight: 700;
}

.register-open-btn {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.register-box {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid #d1d1d1;
  background: #dddddd;
  padding: 12px;
}

.register-box h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.forgot-modal-card {
  width: min(440px, 100%);
  height: auto;
  padding-bottom: 18px;
}

.forgot-form {
  padding: 14px 14px 0;
  max-width: none;
}

.register-form {
  margin-top: 2px;
}

.hidden {
  display: none !important;
}

.feedback {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: calc(100% - 20px);
  max-width: 430px;
  background: rgba(18, 18, 18, 0.94);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.feedback.is-visible {
  opacity: 1;
}

.feedback[data-kind='success'] {
  background: rgba(29, 106, 48, 0.94);
}

.feedback[data-kind='error'] {
  background: rgba(141, 29, 29, 0.94);
}

@media (min-width: 1024px) {
  .auth-shell {
    padding: 24px;
  }

  .auth-card {
    max-width: 520px;
    min-height: 740px;
    padding: 102px 30px 30px;
  }

  .auth-card-register {
    min-height: auto;
    padding: 44px 30px 30px;
  }

  .brand-box {
    font-size: 3.7rem;
  }

  .stack-sm,
  .register-callout,
  .register-open-btn {
    max-width: 320px;
  }
}
