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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-focus: #818cf8;
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ====== Layout ====== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 16px 20px;
}

.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 28px;
  width: 100%;
  max-width: 560px;
}

.page-footer {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ====== Form Header ====== */
.form-header {
  text-align: center;
  margin-bottom: 16px;
}

.form-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ====== Form Groups ====== */
.form-group {
  margin-bottom: 10px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}

.required {
  color: var(--danger);
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
}

input, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

input::placeholder, textarea::placeholder {
  color: #9ca3af;
}

textarea {
  resize: vertical;
  min-height: 64px;
}

/* Error states */
input.error, textarea.error {
  border-color: var(--danger);
}

input.error:focus, textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
  min-height: 14px;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-secondary:hover {
  background: #e0e7ff;
}

.btn-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

/* ====== Success Banner ====== */
.success-banner {
  text-align: center;
  padding: 32px 20px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--success-light);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
}

.success-banner h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.success-banner p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.success-banner .btn {
  width: auto;
  padding: 10px 24px;
}

/* ====== Responsive ====== */
@media (max-width: 600px) {
  .form-card {
    padding: 20px 16px;
  }

  .form-header h1 {
    font-size: 20px;
  }
}
