:root {
  --accent: #ef394e;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f7f7;
}

body {
  margin: 0;
  background: var(--bg);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  padding: 24px 22px 64px 22px;
}

.back-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.08s ease;
}
.back-btn:hover {
  color: #374151;
  transform: translateX(2px);
}
.back-btn svg {
  width: 20px;
  height: 20px;
}

.brand {
  text-align: center;
  margin: 8px 0 56px 0;
}
.brand img {
  height: 56px;
  width: auto;
}
.brand-text {
  margin-top: 6px;
  text-align: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 20px;
}

.title {
  margin: 10px 0 6px 0;
  text-align: right;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.hello {
  margin: 8px 0 0 0;
  text-align: right;
  color: var(--text);
  font-weight: 600;
}
.subtitle {
  margin: 56px 0 0 0;
  text-align: right;
  color: var(--muted);
  font-size: 14px;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.1);
}
.helper {
  display: none;
  margin-top: 6px;
  color: #d10000;
  font-size: 12px;
  text-align: right;
}
.has-error .helper {
  display: block;
}

.btn-primary {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: #f390b2;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.btn-primary:hover {
  filter: brightness(0.95);
}

.inline-link {
  color: #f390b2;
  text-decoration: none;
}
.inline-link:hover {
  text-decoration: underline;
}
.terms {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .auth-wrap {
    padding: 40px;
  }
  .brand img {
    height: 64px;
  }
  .auth-card {
    padding: 28px 24px 72px 24px;
  }
}

@media (max-width: 360px) {
  .auth-card {
    padding: 18px 16px 72px 16px;
    border-radius: 14px;
    min-height: 62vh;
  }
  .brand img {
    height: 48px;
  }
  .brand {
    margin: 8px 0 32px 0;
  }
  .subtitle {
    margin: 12px 0 0 0;
  }
  .terms {
    bottom: 8px;
  }
  .form-control,
  .btn-primary {
    height: 40px;
    font-size: 14px;
  }
}

@media (max-height: 700px) {
  .auth-card {
    min-height: 64vh;
  }
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-overlay.show {
  display: flex;
}
.modal-dialog {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  padding: 20px 20px 16px 20px;
}
.modal-dialog h2 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-align: right;
}
.modal-body {
  color: #374151;
  font-size: 14px;
  line-height: 1.9;
  text-align: right;
  max-height: 60vh;
  overflow: auto;
  margin-bottom: 12px;
}
.modal-close-btn {
  margin-top: 4px;
}

/* Moved former inline styles */
.auth-card .alert {
  background: #fff5f5;
  border: 1px solid #ffd3d6;
  color: #a40000;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.spacer-12 {
  height: 12px;
}

.text-center {
  text-align: center;
}

.modal-body ul {
  margin: 0 1rem 0 0;
  padding: 0 1rem 0 0;
}
