* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --error: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-800: #1f2937;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--gray-800);
    line-height: 1.6;
}
.container {
    max-width: 680px; margin: 0 auto; background: #fff;
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden;
}
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; padding: 2rem; text-align: center;
}
.header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.subtitle { font-size: 0.95rem; opacity: 0.9; }
form { padding: 2rem; }
.form-group { margin-bottom: 1.3rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="file"], textarea {
    width: 100%; padding: 0.75rem; border: 1.5px solid var(--gray-200);
    border-radius: 8px; font-size: 1rem; font-family: inherit;
    transition: all 0.2s ease; background: var(--gray-50);
}
input:focus, textarea:focus {
    outline: none; border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}
textarea { resize: vertical; min-height: 150px; }
.hint { display: block; font-size: 0.8rem; color: var(--gray-400); margin-top: 0.3rem; }
button {
    width: 100%; background: var(--primary); color: #fff; border: none;
    padding: 1rem; border-radius: 8px; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; margin-top: 0.5rem;
}
button:hover {
    background: var(--primary-dark); transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79,70,229,0.3);
}
button:disabled { opacity: 0.6; cursor: not-allowed; }
.error { display: block; color: var(--error); font-size: 0.85rem; margin-top: 0.3rem; font-weight: 500; }
.alert { padding: 1rem 1.2rem; margin: 1.5rem 2rem 0; border-radius: 8px; font-size: 0.95rem; font-weight: 500; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.footer { text-align: center; padding: 1.5rem; font-size: 0.85rem; color: var(--gray-400); border-top: 1px solid var(--gray-100); }
.footer a { color: var(--primary); text-decoration: none; }
@media (max-width: 600px) {
    body { padding: 1rem 0.5rem; }
    .header { padding: 1.5rem 1rem; }
    form { padding: 1.5rem 1rem; }
    .alert { margin: 1rem 1rem 0; }
}

/* ====== SIGNATURE ====== */
.signature-wrapper {
    border: 2px dashed #d0d5dd;
    border-radius: 8px;
    padding: 0.5rem;
    background: #fafbfc;
}

#signature-pad {
    width: 100%;
    height: 180px;
    background: #fff;
    border-radius: 6px;
    cursor: crosshair;
    touch-action: none;
    display: block;
}

.signature-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding: 0 0.3rem;
}

.btn-clear {
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #d0d5dd;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    width: auto;
    margin: 0;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #f3f4f6;
    color: #ef4444;
    border-color: #ef4444;
}

.signature-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

@media (max-width: 600px) {
    #signature-pad {
        height: 140px;
    }
}
