:root {
  --bg: #f5f0eb;
  --card: #ffffff;
  --accent: #2c5f2d;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #d1c7b7;
  --input-bg: #faf8f5;
  --error: #dc2626;
  --success: #16a34a;
  --shadow: 0 4px 24px rgba(26,26,46,0.08);
  --radius: 12px;
}

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

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 1rem;
}

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

.header { text-align: center; padding: 2rem 1rem 1.5rem; }
.header__logo {
  width: 56px; height: 56px;
  background: var(--accent); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(44,95,45,0.3);
}
.header__logo svg { width: 28px; height: 28px; fill: white; }
.header h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.header p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem;
}

.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.4rem;
}
.field input {
  width: 100%; padding: 0.85rem 1rem; font-size: 1.05rem;
  font-family: 'Manrope', sans-serif;
  background: var(--input-bg); border: 2px solid var(--border);
  border-radius: 10px; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,95,45,0.12);
}
.field input.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.field .hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }

.row { display: flex; gap: 0.75rem; }
.row .field { flex: 1; }

.signature-area { position: relative; }
.signature-area canvas {
  width: 100%; height: 140px;
  border: 2px dashed var(--border); border-radius: 10px;
  background: var(--input-bg); cursor: crosshair; touch-action: none;
}
.signature-area canvas.has-signature { border-style: solid; border-color: var(--accent); }
.signature-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem; color: var(--border);
  pointer-events: none; transition: opacity 0.3s;
}
.signature-hint.hidden { opacity: 0; }
.clear-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-top: 0.5rem; padding: 0.4rem 0.8rem;
  font-size: 0.8rem; font-family: 'Manrope', sans-serif; font-weight: 500;
  color: var(--text-muted); background: none;
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.clear-btn:hover { color: var(--error); border-color: var(--error); }

.submit-btn {
  width: 100%; padding: 1rem; font-size: 1.1rem;
  font-family: 'Manrope', sans-serif; font-weight: 700;
  color: white; background: var(--accent); border: none;
  border-radius: var(--radius); cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(44,95,45,0.3);
}
.submit-btn:hover { background: #234d24; transform: translateY(-1px); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-content {
  background: white; border-radius: 16px; width: 100%; max-width: 700px;
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; border: none; border-radius: 8px;
  cursor: pointer; font-size: 1.2rem; color: var(--text-muted);
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }
.modal-content iframe { flex: 1; width: 100%; min-height: 50vh; border: none; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid #eee; }
.send-btn {
  width: 100%; padding: 0.9rem; font-size: 1rem;
  font-family: 'Manrope', sans-serif; font-weight: 700;
  color: white; background: var(--accent); border: none;
  border-radius: 10px; cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(44,95,45,0.3);
}
.send-btn:hover { background: #234d24; }
.send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.send-btn.success { background: var(--success); }
.send-btn.error { background: var(--error); }

.footer { text-align: center; padding: 1rem; font-size: 0.75rem; color: var(--text-muted); }

.toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text); color: white; padding: 0.8rem 1.5rem;
  border-radius: 10px; font-size: 0.9rem; font-weight: 500;
  z-index: 2000; transition: transform 0.3s ease; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.success-state { text-align: center; padding: 0.25rem 0; }
.success-icon { font-size: 2.5rem; color: var(--success); margin-bottom: 0.4rem; }
.success-title { font-size: 1.05rem; font-weight: 700; color: var(--success); margin-bottom: 0.3rem; }
.success-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
