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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 2rem;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

/* Views */
.view {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.view.hidden {
  display: none;
}

.hidden {
  display: none;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.lang-btn {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: #e9ecef;
  color: #495057;
  border: 1px solid #ced4da;
  border-radius: 4px;
  cursor: pointer;
}

.lang-btn:hover {
  background: #dee2e6;
}

.lang-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* Typography */
h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: #333;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 1.5rem;
}

.hint {
  font-size: 0.9rem;
  color: #888;
  font-style: italic;
}

.verified-field {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

/* Buttons */
button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  background: #007bff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #0056b3;
}

.btn-secondary {
  width: 100%;
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #545b62;
}

.btn-link {
  background: none;
  color: #007bff;
  padding: 0.5rem;
  width: auto;
}

.btn-link:hover {
  text-decoration: underline;
  background: none;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-back {
  display: block;
  margin-top: 1.5rem;
  text-align: center;
}

/* Button Group (Landing) */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.date-select-row {
  display: flex;
  gap: 0.5rem;
}

.date-select-row select {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
}

input[type="text"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #007bff;
}

textarea {
  resize: vertical;
  font-family: inherit;
}

/* OTP Steps */
.otp-step {
  text-align: center;
}

.otp-step.hidden {
  display: none;
}

.otp-step input {
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 0.5rem;
  max-width: 250px;
  margin: 0 auto 1rem;
}

#otp-phone-display {
  font-weight: 600;
}

/* Success Box */
.success-box {
  text-align: center;
}

.success-box h2 {
  color: #28a745;
}

.success-box p {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.success-box .btn-primary {
  display: inline-block;
  width: auto;
  text-decoration: none;
  margin-bottom: 1rem;
}

/* Search Results */
.result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.result.hidden {
  display: none;
}

.result.not-found {
  border-left: 4px solid #dc3545;
}

.result.found {
  border-left: 4px solid #28a745;
}

.member-info {
  margin-bottom: 1.5rem;
}

.member-info p {
  margin: 0.5rem 0;
  color: #333;
}

.member-info strong {
  color: #555;
  min-width: 80px;
  display: inline-block;
}

.view-card {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

.view-card:hover {
  background: #1e7e34;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.status-badge.verified {
  background: #d4edda;
  color: #155724;
}

.status-badge.not-found {
  background: #f8d7da;
  color: #721c24;
}

/* Message Box */
.message-box {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  border-radius: 4px;
  font-weight: 500;
  z-index: 100;
  max-width: 90%;
}

.message-box.hidden {
  display: none;
}

.message-box.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message-box.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-msg {
  color: #dc3545;
  text-align: center;
}

/* Preview Card */
.preview-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.preview-row:last-child {
  border-bottom: none;
}

.preview-label {
  font-weight: 500;
  color: #666;
  flex-shrink: 0;
  margin-right: 1rem;
}

.preview-value {
  text-align: right;
  color: #333;
  word-break: break-word;
}

.preview-buttons {
  flex-direction: row;
  gap: 1rem;
}

.preview-buttons .btn-secondary,
.preview-buttons .btn-primary {
  flex: 1;
}

/* Validation Errors */
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: #dc3545;
  background-color: #fff8f8;
}

.form-group.has-error label {
  color: #dc3545;
}

.field-error {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

.char-count {
  font-size: 0.75rem;
  color: #888;
  text-align: right;
  margin-top: 0.25rem;
}

.char-count.warning {
  color: #ffc107;
}

.char-count.error {
  color: #dc3545;
}
