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

html, body {
  overflow-x: hidden;
}

:root {
  color-scheme: light dark;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  padding: 2rem;
  background: #f5f7fb;
  color: #17202a;
  min-height: 100vh;
}

main {
  max-width: 720px;
  width: min(100%, 720px);
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

h1 {
  margin-top: 0;
}

form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

form input,
form select,
form button,
.modal-buttons button {
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid #cfd8e3;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

button {
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
  min-height: 50px;
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #eff6ff;
  border-radius: 8px;
}

.error {
  color: #b91c1c;
  background: #fef2f2;
}

#feedback-button {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  padding: 14px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  z-index: 9999;
  border: none;
  transition: all 0.3s ease;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#feedback-button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.modal-feedback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-feedback[hidden] {
  display: none !important;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: min(100%, 420px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}

.feedback-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.feedback-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  main {
    padding: 1.5rem;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.6rem;
  }

  form {
    gap: 0.9rem;
  }

  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .modal-buttons {
    flex-direction: column;
  }

  #feedback-button {
    bottom: 14px;
    right: 14px;
    padding: 12px 14px;
    font-size: 0.9rem;
  }
}

.modal-content h2 {
  margin-top: 0;
  color: #1f2937;
}

.modal-content p {
  color: #666;
  line-height: 1.5;
  margin: 1rem 0;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-buttons button {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-feedback {
  background: #2563eb;
  color: white;
}

.btn-feedback:hover {
  background: #1d4ed8;
}

.btn-close {
  background: #f3f4f6;
  color: #1f2937;
}

.btn-close:hover {
  background: #e5e7eb;
}

.feedback-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}

.feedback-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.feedback-footer a:hover {
  text-decoration: underline;
}
