:root {
  --lime: #b5e941;
  --lime-hover: #a5d93a;
  --dark-green: #1d4b00;
  --text: #2d333a;
  --muted: #6f7780;
  --border: #c2c8d0;
  --error: #d00e17;
  --gray-light: #f1f2f3;
  --focus-color: #007bad;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, sans-serif;
  background: #f5f5f5;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Simple Header */
.header-simple {
  background: white;
  border-bottom: 1px solid #d9d9d9;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-back {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.header-back:hover {
  color: var(--dark-green);
}

.header-logo-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.header-logo-center img {
  height: 48px;
}

.header-help {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.header-help:hover {
  color: var(--dark-green);
}

.auth {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 40px;
  background: white;
}

.auth__inner {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 12px;
  padding: 40px 36px 32px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.auth__head {
  text-align: center;
  margin-bottom: 24px;
}

.auth__logo {
  width: 179px;
  height: 30px;
  display: block;
  margin: 0 auto 24px;
}

.auth__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.auth__subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step[hidden] {
  display: none !important;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  line-height: 1.1;
  transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.input:focus::placeholder {
  color: var(--muted);
}

.input:focus {
  border-color: var(--focus-color);
  box-shadow: 0 0 0 1px var(--focus-color);
}

.input.invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px var(--error) !important;
  color: var(--error);
}

.input.invalid::placeholder {
  color: var(--error) !important;
  opacity: 1;
}


.input.invalid:-webkit-autofill {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px var(--error), inset 0 0 0 9999px white !important;
}

.error {
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
}

.error:empty {
  display: none;
}

.verification-box {
  background: #2d2d2d;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 2px 0;
  width: 100%;
  display: flex;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.verification-content {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.verification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verification-dots {
  animation: spin 1s linear infinite;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.verification-dots[hidden] {
  display: none;
}

.verification-check {
  width: 32px;
  height: 32px;
}

.verification-check svg {
  width: 100%;
  height: 100%;
  animation: checkFadeIn 0.3s ease;
}

.verification-text {
  color: #ffffff;
  font-size: 15px;
  font-weight: 400;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes checkFadeIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.btn-primary {
  width: 100%;
  height: 42px;
  padding: 4px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--dark-green);
  background: var(--lime);
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--lime-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.header .btn-primary {
  width: auto;
  height: auto;
  padding: 8px 20px;
  font-size: 14px;
  display: inline-flex;
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  align-self: center;
}

.btn-link:hover {
  color: var(--text);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 8px 0 0;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-card:hover {
  background: #fafafa;
}

.radio-card:has(input:checked) {
  border-color: var(--dark-green);
  background: #f4fbe8;
}

.radio-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--dark-green);
  flex-shrink: 0;
}

.radio-card__body {
  display: flex;
  flex-direction: column;
}

.radio-card__title {
  font-size: 14px;
  font-weight: 600;
}

.radio-card__desc {
  font-size: 13px;
  color: var(--muted);
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 46px;
}

.toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 6px;
  display: flex;
  color: var(--muted);
  cursor: pointer;
}

.toggle-pw:hover {
  color: var(--text);
}

.pw-hints {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pw-hints li {
  font-size: 12px;
  color: var(--muted);
  padding-left: 18px;
  position: relative;
}

.pw-hints li::before {
  content: "○";
  position: absolute;
  left: 0;
}

.pw-hints li.ok {
  color: var(--dark-green);
}

.pw-hints li.ok::before {
  content: "✓";
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--dark-green);
  flex-shrink: 0;
}

.legal {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.success-box {
  border: 1px solid var(--dark-green);
  background: #f4fbe8;
  border-radius: 8px;
  padding: 16px;
}

.success-box__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark-green);
  margin: 0 0 6px;
}

.success-box__text {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.email-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  height: 44px;
  background: white;
}

.email-display__text {
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-display__edit {
  color: var(--dark-green);
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
  flex-shrink: 0;
  margin-left: 12px;
}

.step__link-row {
  text-align: left;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--error);
  line-height: 1.4;
  margin-top: 4px;
}

.login-error[hidden] {
  display: none;
}

.login-error__icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.auth__register {
  margin-top: 16px;
  text-align: left;
  font-size: 14px;
  color: var(--muted);
}

.auth__register p {
  margin: 0;
  line-height: 1.6;
}

.link {
  color: var(--dark-green);
  font-weight: 600;
  text-decoration: underline;
}

.link:hover {
  opacity: 0.7;
}

.auth__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  font-size: 14px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .auth {
    padding: 0;
    background: white;
  }

  .auth__inner {
    box-shadow: none;
    border-radius: 0;
    padding: 24px 16px 32px;
    max-width: 100%;
  }

  .auth__title {
    font-size: 18px;
  }

  .auth__subtitle {
    font-size: 13px;
  }

  .header-simple {
    padding: 12px 16px;
  }

  .header-logo-center img {
    height: 36px;
  }

  .input {
    height: 48px;
    font-size: 16px;
  }

  .btn-primary {
    height: 48px;
    font-size: 15px;
  }

  .email-display {
    height: 48px;
  }

  .loading-page__title {
    font-size: 22px;
  }

  .loading-page__text {
    font-size: 14px;
  }

  .loading-page__spinner {
    width: 60px;
    height: 60px;
  }
}

/* SMS Modal & Notifications */
.sms-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sms-modal__content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sms-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.sms-modal__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.sms-modal__close {
  background: none;
  border: 0;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.sms-modal__body {
  padding: 16px;
  color: var(--text);
}

.sms-modal__body p {
  margin: 0 0 8px;
}

.sms-modal__time {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px !important;
}

.sms-modal__footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
}

.sms-modal__footer .btn-primary {
  margin: 0;
}

.notif {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9998;
  animation: slideInRight 0.3s;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notif--success {
  background: #f4fbe8;
  color: var(--dark-green);
  border: 1px solid var(--dark-green);
}

.notif--error {
  background: #fde8e8;
  color: var(--error);
  border: 1px solid var(--error);
}

.notif--info {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #1976d2;
}

/* SMS Input Styling */
.input--code {
  font-size: 18px;
  letter-spacing: 8px;
  text-align: center;
  font-weight: 600;
  font-family: "Courier New", monospace;
}

.auth__timer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.auth__timer p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}

.sms-modal__code-input {
  margin: 16px 0;
}

.sms-modal__code-input .input {
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  font-weight: 600;
  font-family: "Courier New", monospace;
}

.sms-verify-success {
  background: #f4fbe8;
  color: var(--dark-green);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  margin-top: 12px;
  font-weight: 600;
  animation: slideDown 0.3s;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SMS Verification */
.code-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input--code {
  font-size: 16px !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  font-weight: 400 !important;
  font-family: inherit !important;
  padding-right: 44px !important;
}

.toggle-code {
  position: absolute;
  right: 12px;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toggle-code:hover {
  color: var(--text);
}

.auth__timer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.link-timer {
  color: var(--dark-green);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.2s;
}

.link-timer:hover {
  opacity: 0.7;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner {
  background: white;
  border-radius: 12px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--lime);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  color: var(--text);
  font-weight: 500;
  margin: 0;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 40px 20px;
  animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.success-content svg {
  color: var(--dark-green);
  animation: checkmark 0.6s ease-out;
}

@keyframes checkmark {
  0% {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
  }
}

.success-content h2 {
  color: var(--dark-green);
  margin: 0;
  font-size: 24px;
}

.success-content p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

/* Loading Page */
.loading-page {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeInPage 0.3s ease-out;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.loading-page__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.loading-page__spinner {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-svg {
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

.spinner-circle {
  fill: none;
  stroke: var(--lime);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 0;
  animation: spinDash 1.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes spinDash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.loading-page__title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.loading-page__text {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.loading-page__dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.loading-page__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  animation: bounce 1.4s ease-in-out infinite;
}

.loading-page__dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-page__dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-page__dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

.loading-page__btn {
  background: var(--lime);
  color: var(--dark-green);
  border: 0;
  padding: 14px 40px;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 24px;
  box-shadow: 0 2px 8px rgba(181, 233, 65, 0.3);
  display: inline-block;
}

.loading-page__btn:hover {
  background: var(--lime-hover);
  box-shadow: 0 4px 12px rgba(181, 233, 65, 0.4);
  transform: translateY(-2px);
}

.loading-page__btn:active {
  transform: translateY(0);
}

