/* === CSS Variables === */
:root {
  --primary-color: #B5E941;
  --primary-hover: #a3d136;
  --button-font-color: #1D4B00;
  --text-color: #0C0C0B;
  --text-secondary: #77756F;
  --link-color: #326916;
  --border-color: #dddbd5;
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --error-color: #B30C0C;
  --input-bg: #ffffff;
  --input-border: #95958E;
  --input-focus-border: #0C0C0B;
  --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --button-height: 48px;
  --input-height: 48px;
  --border-radius-outer: 16px;
  --input-border-radius: 8px;
  --button-border-radius: 9999px;
  --prompt-width: 540px;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

a:hover {
  text-decoration: underline;
}

/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--card-bg);
  text-align: center;
  height: 50px;
  width: 100%;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.header__logo-link {
  display: inline-block;
  text-decoration: none;
}

.header__logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.header__logo-img {
  height: 28px;
  width: auto;
}

.header__logo-text:hover {
  text-decoration: none;
}

.header__back {
  display: inline-block;
  cursor: pointer;
  position: absolute;
  left: 0;
  margin-left: 12px;
  width: 24px;
  height: 24px;
  color: var(--link-color);
}

.header__back svg {
  width: 100%;
  height: 100%;
  display: block;
}

.header__help-link {
  position: absolute;
  right: 0;
  margin-right: 12px;
  font-size: 0.875rem;
}

/* === Main === */
.main {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

/* === Card === */
.card {
  width: 100%;
  max-width: var(--prompt-width);
  background: var(--card-bg);
  border-radius: var(--border-radius-outer);
  padding: 40px 36px;
}

.card__logo-mobile {
  display: none;
  text-align: center;
  margin-bottom: 24px;
}

.card__logo-mobile .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  color: var(--text-color);
}

.card__subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* === Form === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--text-color);
}

.form-label .required {
  color: var(--error-color);
}

.form-input {
  display: block;
  width: 100%;
  height: var(--input-height);
  padding: 0 14px;
  font-size: 1rem;
  font-family: var(--font-family);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-border-radius);
  color: var(--text-color);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(12, 12, 11, 0.15);
}

.form-input.error {
  border-color: var(--error-color);
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(179, 12, 12, 0.15);
}

/* === Password field wrapper === */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 0 var(--input-border-radius) var(--input-border-radius) 0;
}

.password-toggle:hover {
  color: var(--text-color);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* === Error message === */
.form-error {
  font-size: 0.8125rem;
  color: var(--error-color);
  margin-top: 4px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* === Email edit link inside input === */
.email-edit-link {
  width: auto;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--link-color);
  white-space: nowrap;
  text-decoration: none;
}

.email-edit-link:hover {
  text-decoration: underline;
}

/* === Buttons === */
.btn {
  display: block;
  width: 100%;
  height: var(--button-height);
  border: none;
  border-radius: var(--button-border-radius);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--button-font-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-social {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-social:hover {
  background: var(--bg-color);
}

.btn-social svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* === Divider === */
.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  gap: 16px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider__text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* === Footer links === */
.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-footer a {
  text-decoration: underline;
}

.forgot-password {
  display: block;
  text-align: left;
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  text-decoration: underline;
}

/* === Step visibility === */
.step {
  display: none;
}

.step.active {
  display: block;
}

/* === Desktop === */
@media (min-width: 601px) {
  .header {
    height: 72px;
  }

  .card__logo-mobile {
    display: none;
  }

  .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  }
}

/* === Mobile === */
@media (max-width: 600px) {
  .main {
    padding: 24px 0 0 0;
  }

  .card {
    border-radius: 0;
    min-height: calc(100vh - 50px);
    padding: 24px 16px;
  }
}

/* === Screen visibility === */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* === Loader === */
.loader-container {
  text-align: center;
  padding: 40px 0;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* === Message box === */
.message-box {
  background: #f8f8f6;
  border: 1px solid var(--border-color);
  border-radius: var(--input-border-radius);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-color);
}

/* === Done === */
.done-container {
  text-align: center;
  padding: 40px 0;
}

/* === Select input === */
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2377756F' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* === Modal overlay === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

#login-overlay {
  z-index: 1010;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-outer);
  padding: 36px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-buttons .btn {
  flex: 1;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--input-border);
}

.btn-secondary:hover {
  background: #f5f5f3;
}

.sms-resend {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 4px;
}

.sms-resend a {
  font-size: 0.8125rem;
}

.sms-resend-success {
  font-size: 0.8125rem;
  color: var(--link-color);
  display: none;
  margin-bottom: 8px;
}

.sms-resend-success.visible {
  display: block;
}

/* === Success page === */
.success-container {
  text-align: center;
  padding: 20px 0;
}

.success-icon {
  width: 120px;
  height: auto;
  margin-bottom: 24px;
}

.success-text {
  text-align: center;
  line-height: 1.6;
  margin-bottom: 16px;
}

.success-link {
  display: inline-block;
  color: var(--link-color);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 8px;
}

/* === Reset password page === */
.reset-warning {
  background: #fff8e1;
  border: 1px solid #f5d060;
  border-radius: var(--input-border-radius);
  padding: 14px 16px;
  margin: 20px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-color);
  text-align: left;
}

.reset-info {
  text-align: left;
  margin-top: 20px;
}

.reset-info__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
}

.reset-info__list {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 20px;
  margin: 0;
}

.reset-info__list li {
  margin-bottom: 4px;
}

/* === SMS Modal (Kleinanzeigen style) === */
.sms-modal {
  background: var(--card-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sms-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
  gap: 12px;
}

.sms-modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.3;
  margin: 0;
}

.sms-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.sms-modal__close:hover {
  color: var(--text-color);
}

.sms-modal__body {
  padding: 0 24px 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.sms-modal__hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 0;
}

.sms-modal__body .sms-resend {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sms-modal__body .sms-resend a {
  color: var(--text-color);
  font-size: 0.875rem;
}

.sms-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.sms-modal__footer .btn {
  width: auto;
  padding: 0 24px;
  height: 40px;
  font-size: 0.875rem;
  border-radius: 20px;
}

.btn-outline {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: #f5f5f3;
}

.btn-primary-light {
  background: #e8f5c8;
  color: var(--button-font-color);
  border: none;
}

.btn-primary-light:hover {
  background: #d9ecb0;
}
