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

body {
  font-family: 'Helvetica Neue', Arial, 'Noto Sans Thai', sans-serif;
  background: #f0f2f0;
  color: #333;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

/* Loading */
#loadingScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.loading-inner {
  text-align: center;
  color: #888;
}

.loading-inner p {
  margin-top: 12px;
  font-size: 14px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #00B900;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Header */
.header {
  background: #00B900;
  color: #fff;
  padding: 28px 16px 22px;
  text-align: center;
}

.logo-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
}

/* Tabs */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e8e8e8;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab {
  flex: 1;
  padding: 14px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 15px;
  font-weight: 500;
  color: #999;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab.active {
  color: #00B900;
  border-bottom-color: #00B900;
  font-weight: 700;
}

/* Tab Content */
.tab-content {
  padding: 20px 16px 4px;
}

.section-label {
  font-size: 13px;
  color: #888;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Role Grid */
.role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.role-chip {
  padding: 10px 20px;
  border: 2px solid #ddd;
  border-radius: 24px;
  background: #fff;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.role-chip:active {
  transform: scale(0.96);
}

.role-chip.selected {
  border-color: #00B900;
  background: #00B900;
  color: #fff;
}

/* Form Fields */
.form-fields {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  animation: slideIn 0.2s ease;
}

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

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: #333;
  -webkit-appearance: none;
}

.field input:focus {
  border-color: #00B900;
  box-shadow: 0 0 0 3px rgba(0,185,0,0.12);
}

.readonly-input {
  background: #f5f5f5 !important;
  color: #666 !important;
  cursor: default;
}

.req {
  color: #e53935;
}

/* Form Footer */
.form-footer {
  padding: 16px 16px 40px;
}

.privacy-note {
  font-size: 12px;
  color: #bbb;
  text-align: center;
  margin-bottom: 10px;
}

.error-msg {
  color: #e53935;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
  margin-bottom: 8px;
  font-weight: 500;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: #00B900;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.3px;
}

.btn-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-submit:not(:disabled):active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Center Screens (success / already) */
.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  text-align: center;
  background: #fff;
}

.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 24px;
}

.icon-success {
  background: #00B900;
  color: #fff;
}

.icon-info {
  background: #1976d2;
  color: #fff;
  font-style: italic;
  font-size: 40px;
}

.center-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
}

.center-content p {
  font-size: 15px;
  color: #777;
  margin-bottom: 32px;
  line-height: 1.6;
}

.btn-close {
  padding: 14px 44px;
  background: #00B900;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
}

.btn-close:active {
  opacity: 0.85;
}
