* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

/* ===================================
           MOBILE FIRST (Default styles)
           These apply to ALL screen sizes,
           then we add/override for larger screens
           =================================== */

.container {
  max-width: 100%;
  margin: 0 auto;
}

.form-card {
  background: white;
  border-radius: 20px;
  padding: 25px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

/* Form elements - mobile friendly (larger touch targets) */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.required {
  color: #e94560;
  margin-left: 3px;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 15px; /* Larger padding for easier tapping on mobile */
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px; /* 16px prevents zoom on mobile! */
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

/* Focus state - important for mobile keyboard users */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Radio and checkbox groups - mobile friendly */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
}

.radio-option input,
.checkbox-option input {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.radio-option label,
.checkbox-option label {
  margin-bottom: 0;
  cursor: pointer;
  font-weight: normal;
}

button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:active {
  transform: translateY(0);
}

/* Helper text */
.helper-text {
  font-size: 12px;
  color: #999;
  margin-top: 5px;
}

/* Demo explanation */
.demo-info {
  background: #f0f2f5;
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
}

.demo-info h3 {
  color: #333;
  margin-bottom: 10px;
}

/* ===================================
           TABLET STYLES (min-width: 768px)
           These OVERRIDE mobile styles
           =================================== */
@media (min-width: 768px) {
  body {
    padding: 40px;
  }

  .container {
    max-width: 700px;
  }

  .form-card {
    padding: 40px;
  }

  h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 16px;
  }

  /* On tablet, radio/checkbox can be in a row */
  .radio-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }

  .checkbox-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
}

/* ===================================
           DESKTOP STYLES (min-width: 1024px)
           =================================== */
@media (min-width: 1024px) {
  .container {
    max-width: 800px;
  }

  .form-card {
    padding: 50px;
  }

  /* Two-column layout for desktop */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

/* Code display */
.code-block {
  background: #1e1e2e;
  color: #82b1ff;
  padding: 15px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  overflow-x: auto;
  margin-top: 15px;
}

footer {
  text-align: center;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
