/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

body {
  font-family: 'Sarabun', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
  font-size: 16px;
}

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

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo .material-symbols-outlined {
  font-size: 48px;
  font-variation-settings: 'FILL' 1, 'wght' 600;
}

.header h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
}

.subtitle {
  font-size: 18px;
  opacity: 0.95;
  font-weight: 400;
}

/* Alert */
.alert {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--info);
}

.alert-info {
  background: var(--info-light);
  border-left-color: var(--info);
}

.alert .material-symbols-outlined {
  font-size: 28px;
  color: var(--info);
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-content strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gray-800);
  font-size: 16px;
}

.alert-content ol {
  margin-left: 20px;
  color: var(--gray-700);
}

.alert-content li {
  margin-bottom: 6px;
}

/* Card */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header .material-symbols-outlined {
  font-size: 28px;
  font-variation-settings: 'FILL' 1;
}

.card-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 28px 24px;
}

/* Form */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
  font-size: 15px;
}

.form-group label .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s;
  background: var(--gray-50);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Monaco', 'Courier New', monospace;
  line-height: 1.5;
}

.help-text {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 8px;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Status & Results */
.status-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.status-box.loading {
  background: var(--info-light);
  color: var(--info);
  border-left: 4px solid var(--info);
}

.status-box.success {
  background: var(--success-light);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.status-box.error {
  background: var(--danger-light);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.results-box {
  margin-top: 20px;
}

.result-item {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.result-item-success {
  background: var(--success-light);
  border-color: var(--success);
}

.result-item strong {
  display: block;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.result-item code {
  background: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  display: inline-block;
  margin: 4px 0;
  border: 1px solid var(--gray-200);
}

.copy-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 8px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--gray-200);
}

/* OTP Result */
.otp-result {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--success-light) 0%, #f0fdf4 100%);
  border: 3px solid var(--success);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.otp-code {
  font-size: 48px;
  font-weight: 700;
  font-family: 'Monaco', 'Courier New', monospace;
  color: var(--success);
  letter-spacing: 8px;
  margin: 16px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.otp-meta {
  color: var(--gray-600);
  font-size: 14px;
  margin-top: 12px;
}

/* Footer */
.footer {
  text-align: center;
  color: white;
  margin-top: 40px;
  padding: 20px;
  opacity: 0.9;
}

/* Loading Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .header h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  .card-body {
    padding: 20px 16px;
  }

  .alert {
    flex-direction: column;
    gap: 12px;
  }

  .otp-code {
    font-size: 36px;
    letter-spacing: 6px;
  }
}
